Browse Source

support the dashboard websocket being tunneled over tunnels

Alan Shreve 11 years ago
parent
commit
0d10398f96
1 changed files with 3 additions and 2 deletions
  1. 3 2
      assets/client/static/js/ngrok.js

+ 3 - 2
assets/client/static/js/ngrok.js

@@ -307,7 +307,7 @@ ngrok.controller({
         $scope.txns = txnSvc.all();
         $scope.txns = txnSvc.all();
 
 
         if (!!window.WebSocket) {
         if (!!window.WebSocket) {
-            var ws = new WebSocket("ws://localhost:4040/_ws");
+            var ws = new WebSocket("ws://" + location.host + "/_ws");
             ws.onopen = function() {
             ws.onopen = function() {
                 console.log("connected websocket for real-time updates");
                 console.log("connected websocket for real-time updates");
             };
             };
@@ -319,7 +319,8 @@ ngrok.controller({
             };
             };
 
 
             ws.onerror = function(err) {
             ws.onerror = function(err) {
-                console.log("Web socket error:" + err);
+                console.log("Web socket error:")
+                console.log(err);
             };
             };
 
 
             ws.onclose = function(cls) {
             ws.onclose = function(cls) {