diff --git a/js/slidenotes.js b/js/slidenotes.js
index 9a4f15254cc58e9864ebe133015d3cf39d52098a..ef05062a251af6301de49ffd087fc881312dc796 100644
--- a/js/slidenotes.js
+++ b/js/slidenotes.js
@@ -3,8 +3,8 @@
   var qs = window.location.href.split('?');
   if (qs.length > 1 && qs[1].match('receiver')) { return; }
 
-  var socket = io.connect('http://localhost:1947');
-  
+  var socket = io.connect(window.location.origin);
+
   Reveal.addEventListener( 'slidechanged', function( event ) {
     var nextindexh;
     var nextindexv;