diff --git a/public/js/clonos.js b/public/js/clonos.js index 7881f757..2a58077f 100644 --- a/public/js/clonos.js +++ b/public/js/clonos.js @@ -2606,7 +2606,7 @@ var clonos={ wsconnect:function() { this.client_id=Math.random(10000); // поменять на сессию - this.socket = new WebSocket("ws://"+_server_name+":8023/clonos"+location.pathname); + this.socket = new WebSocket("ws://"+location.hostname+":8023/clonos"+location.pathname); $(this.socket).on('open',$.proxy(this.wsopen,this)) .on('close',$.proxy(this.wsclose,this)) .on('error',$.proxy(this.wserror,this)) @@ -3251,7 +3251,7 @@ graphs={ { console.log('Соединяемся по сокету'); this.client_id=this.name; - socket = new WebSocket("ws://"+_server_name+":8024/graph"+location.pathname+"client-"+Math.random()); + socket = new WebSocket("ws://"+location.hostname+":8024/graph"+location.pathname+"client-"+Math.random()); $(socket).on('open',$.proxy(this.wsopen,this)) .on('close',$.proxy(this.wsclose,this)) .on('error',$.proxy(this.wserror,this)) @@ -3598,4 +3598,4 @@ function ws_debug(){ $(window).on('load',function(){clonos.start();}); $(window).on('unload',function(){}); /* эта функция заставляет FireFox запускать JS-функции при нажатии кнопки «Назад» http://stackoverflow.com/questions/2638292/after-travelling-back-in-firefox-history-javascript-wont-run */ -$(function(){clonos.loadData('getJsonPage',$.proxy(clonos.onLoadData,clonos));}); \ No newline at end of file +$(function(){clonos.loadData('getJsonPage',$.proxy(clonos.onLoadData,clonos));});