Browse Source

UI: Fix websocket port detection for MS Edge and IE

pull/101/head
Igor Kulikov 10 years ago
parent
commit
ff88d8ce81
  1. 2
      ui/package.json
  2. 10
      ui/src/app/api/telemetry-websocket.service.js

2
ui/package.json

@ -1,7 +1,7 @@
{
"name": "thingsboard",
"private": true,
"version": "1.2.2",
"version": "1.2.3",
"description": "Thingsboard UI",
"licenses": [
{

10
ui/src/app/api/telemetry-websocket.service.js

@ -45,15 +45,21 @@ function TelemetryWebsocketService($rootScope, $websocket, $timeout, $window, ty
socketCloseTimer,
reconnectTimer;
var port = location.port;
if (location.protocol === "https:") {
if (!port) {
port = "443";
}
telemetryUri = "wss:";
} else {
if (!port) {
port = "80";
}
telemetryUri = "ws:";
}
telemetryUri += "//" + location.hostname + ":" + location.port;
telemetryUri += "//" + location.hostname + ":" + port;
telemetryUri += "/api/ws/plugins/telemetry";
var service = {
subscribe: subscribe,
unsubscribe: unsubscribe

Loading…
Cancel
Save