Added dynamic socket.io hostname

This commit is contained in:
Chris Blanchard 2015-07-22 15:13:08 +01:00
parent c22e1df4e1
commit d2ee19a095
2 changed files with 6 additions and 2 deletions

View File

@ -222,7 +222,8 @@ var MessageBar = React.createClass({
var socket;
function initialiseComponents () {
socket = io("http://localhost:8000/")
var socketUrl = window.location.protocol + "//" + window.location.host;
socket = io(socketUrl)
.on("connect", function () {
console.log("Connected");
})

File diff suppressed because one or more lines are too long