-
Notifications
You must be signed in to change notification settings - Fork 359
Description
yout code include:
first:
var server = 'http://catlobby.maxogden.com';
var remoteConfigUrl = 'https://instant.io/rtcConfig';
if (process.browser) remoteConfigUrl = 'http://cors.maxogden.com/' + remoteConfigUrl;
function verifyRoom (room, cb) {
second:
// ensure room is still open
nets({method: 'POST', uri: server + '/v1/' + room + '/pong', json: {ready: true}}, function response (err, resp, data) {
if (err){
console.log('connect server error: ', err);
return cb(err)
}
if (resp.statusCode !== 200) return cb(new Error('Invalid or expired invite code'))
cb()
})
}
thrid:
// get remote webrtc config (ice/stun/turn)
function getRemoteConfig (cb) {
nets({url: remoteConfigUrl, json: true}, function gotConfig (err, resp, config) {
if (err || resp.statusCode > 299) config = undefined // ignore errors
cb(null, config)
})
}
fourth:
// get remote webrtc config (ice/stun/turn)
function getRemoteConfig (cb) {
nets({url: remoteConfigUrl, json: true}, function gotConfig (err, resp, config) {
if (err || resp.statusCode > 299) config = undefined // ignore errors
cb(null, config)
})
}
I think that this two url is to deal code, but I think your server is down , I want to ask you what logic about your two request( uri: server + '/v1/' + room + '/pong' and url: remoteConfigUrl,), and the getRemoteConfig function return the data is or not json format? please give me an example of the config object
I want to create server about like your 'http://catlobby.maxogden.com' to deal code logic , but I do not how to create and the server Background logic and field of your data