diff --git a/.htaccess b/.htaccess index 105d8c48..fbb84555 100755 --- a/.htaccess +++ b/.htaccess @@ -5,8 +5,8 @@ RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L] #Comment out the two folling lines when running server locally to fix issues with localhost -RewriteCond %{HTTPS} !=on -RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L] +#RewriteCond %{HTTPS} !=on +#RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L] RewriteRule ^remote/(.*) php/controller.php?id=$1 [L] diff --git a/server/server.js b/server/server.js index ac3d4aa9..34e75692 100755 --- a/server/server.js +++ b/server/server.js @@ -4,7 +4,7 @@ var server; This if for the localhost running ******/ -localhost = false; +localhost = true; //https server if(localhost) @@ -141,8 +141,9 @@ io.on('connection', function(socket){ socket.on('id', function(arr) { + if(arr.length == 3) - io.to(coll).emit(arr[0], [arr[1], arr[2]]); + io.to(arr[0]).emit(arr[0], [arr[1], arr[2]]); }); socket.on('list', function(list) @@ -152,8 +153,8 @@ io.on('connection', function(socket){ in_list = true; list = list.split(','); coll = list[0].toLowerCase(); - //guid = list[1]; socket.join(coll); + socket.join(rndName(socket.id, 10)); socket.emit("id", rndName(socket.id, 10)); //console.log(name + " joined list " + coll); diff --git a/static/js/list.js b/static/js/list.js index 27be3b40..4fdfae7c 100755 --- a/static/js/list.js +++ b/static/js/list.js @@ -21,6 +21,7 @@ socket.on(chan.toLowerCase(), function(msg){ function channel_function(msg) { + console.log(msg); if(msg[0] == "list") { full_playlist = msg[1]; diff --git a/static/js/remotecontroller.js b/static/js/remotecontroller.js index 583df343..068be5f7 100755 --- a/static/js/remotecontroller.js +++ b/static/js/remotecontroller.js @@ -4,7 +4,7 @@ var id; $(document).ready(function (){ setTimeout(function(){$("#code-input").focus();},500); - socket = io.connect('https://'+window.location.hostname+':3000'); + socket = io.connect('//'+window.location.hostname+':3000'); id = window.location.pathname.split("/")[2]; if(id) {