This commit is contained in:
Ruben van de Ven 2018-11-04 10:26:03 +01:00
parent 5678e90ae6
commit 24585ef523
2 changed files with 4 additions and 2 deletions

View file

@ -130,7 +130,8 @@ Plotly.d3.csv("/1h.csv", function(err, rows){
Plotly.newPlot('graph', data, layout); Plotly.newPlot('graph', data, layout);
var wsUri = window.location.toString().replace('http','ws') + "ws"; var url = window.location.toString().replace('http','ws');
var wsUri = url.substring(0, url.lastIndexOf("/")) + "/ws";
var connectSocket = function() { var connectSocket = function() {
websocket = new WebSocket(wsUri); websocket = new WebSocket(wsUri);

View file

@ -133,7 +133,8 @@ Plotly.d3.csv("/{{ code }}.csv", function(err, rows){
Plotly.newPlot('graph', data, layout); Plotly.newPlot('graph', data, layout);
var wsUri = window.location.toString().replace('http','ws') + "ws"; var url = window.location.toString().replace('http','ws');
var wsUri = url.substring(0, url.lastIndexOf("/")) + "/ws";
var connectSocket = function() { var connectSocket = function() {
websocket = new WebSocket(wsUri); websocket = new WebSocket(wsUri);