Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #12 from danielkutik/master

Connect WebSocket relative to window.location
  • Loading branch information...
commit dd775f055681664fac3ebe3070ead5573e0bfd39 2 parents aa38365 + 2c4fd93
@sarenji sarenji authored
Showing with 8 additions and 7 deletions.
  1. +1 −2  example/index.html
  2. +6 −4 example/server.js
  3. +1 −1  package.json
View
3  example/index.html
@@ -197,8 +197,7 @@
var room = window.location.hash.slice(1);
- //When using localhost
- rtc.connect("ws://localhost:8000/", room);
+ rtc.connect("ws:" + window.location.href.substring(window.location.protocol.length), room);
rtc.on('add remote stream', function(stream, socketId) {
console.log("ADDING REMOTE STREAM...");
View
10 example/server.js
@@ -1,6 +1,8 @@
-var app = require('express').createServer();
-app.listen(8000);
-var webRTC = require('webrtc.io').listen(app);
+var app = require('express')();
+var server = require('http').createServer(app);
+var webRTC = require('webrtc.io').listen(server);
+
+server.listen(8000);
@@ -53,4 +55,4 @@ webRTC.rtc.on('chat_msg', function(data, socket) {
}
}
}
-});
+});
View
2  package.json
@@ -8,7 +8,7 @@
"dependencies": {
"webrtc.io": "latest",
"webrtc.io-client": "latest",
- "express": "2.5.1",
+ "express": "3.1.0",
"ws": "latest"
},
"subdomain": "MultiWebRTC",

0 comments on commit dd775f0

Please sign in to comment.
Something went wrong with that request. Please try again.