Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // bit6 ////////////
- Request.post("https://api.bit6.com/backend/1/ice", {json: true}, function(err, resp, body)
- {
- //if (!err) console.log(JSON.stringify(body, null, 4));
- //reply(body);
- var result = { username: null, password: null, uris: [] };
- //{
- // iceServers:
- // [
- // { url: "stun:turn.bit6.com" },
- // { url: "turn:turn.bit6.com:3478?transport=udp", username: "1469805320:1b173f6245473d2c@1xq81", credential: "J2vf4df6+IJCwbxNos7TxA+asUA=" },
- // { url: "turn:turn.bit6.com:443?transport=tcp", username: "1469805320:1b173f6245473d2c@1xq81", credential: "J2vf4df6+IJCwbxNos7TxA+asUA=" }
- // ],
- // ttl:86400,
- // expires:1469805320
- //}
- /// bit6'den gelen veri yukarıdaki gibi olduğundan
- /// önce biraz değiştirmemiz gerekiyor
- for (i = 0; i < body.iceServers.length; i++)
- {
- if (body.iceServers[i].username)
- {
- result.username = body.iceServers[i].username;
- result.password = body.iceServers[i].credential;
- }
- result.uris.push(body.iceServers[i].url);
- }
- if (result.uris.length == 0)
- {
- result.username = "icadmin";
- result.password = "cCr3016*";
- result.uris = result.uris.concat([
- "stun:212.57.3.179:3478",
- "stun:stun.l.google.com:19302",
- "stun:stun1.l.google.com:19302",
- "stun:stun2.l.google.com:19302",
- "stun:stun3.l.google.com:19302",
- "stun:stun4.l.google.com:19302",
- "turn:212.57.3.179:3478?transport=udp",
- "turn:212.57.3.179:3478",
- "turn:212.57.3.179:3478?transport=tcp" ]);
- }
- result.uris.sort();
- reply(result);
- }).auth("1xq81-AeEVrXsWgiGR", "wSTnVA0JY7W9oOns6ufPpAepU4MAaEjY", true);
- ////////////// bit6
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement