Commit ff88d8ce81c7d8e13f8b6c2298944e337d153229
1 parent
1aa4406c
UI: Fix websocket port detection for MS Edge and IE
Showing
2 changed files
with
9 additions
and
3 deletions
@@ -45,15 +45,21 @@ function TelemetryWebsocketService($rootScope, $websocket, $timeout, $window, ty | @@ -45,15 +45,21 @@ function TelemetryWebsocketService($rootScope, $websocket, $timeout, $window, ty | ||
45 | socketCloseTimer, | 45 | socketCloseTimer, |
46 | reconnectTimer; | 46 | reconnectTimer; |
47 | 47 | ||
48 | + var port = location.port; | ||
48 | if (location.protocol === "https:") { | 49 | if (location.protocol === "https:") { |
50 | + if (!port) { | ||
51 | + port = "443"; | ||
52 | + } | ||
49 | telemetryUri = "wss:"; | 53 | telemetryUri = "wss:"; |
50 | } else { | 54 | } else { |
55 | + if (!port) { | ||
56 | + port = "80"; | ||
57 | + } | ||
51 | telemetryUri = "ws:"; | 58 | telemetryUri = "ws:"; |
52 | } | 59 | } |
53 | - telemetryUri += "//" + location.hostname + ":" + location.port; | 60 | + telemetryUri += "//" + location.hostname + ":" + port; |
54 | telemetryUri += "/api/ws/plugins/telemetry"; | 61 | telemetryUri += "/api/ws/plugins/telemetry"; |
55 | 62 | ||
56 | - | ||
57 | var service = { | 63 | var service = { |
58 | subscribe: subscribe, | 64 | subscribe: subscribe, |
59 | unsubscribe: unsubscribe | 65 | unsubscribe: unsubscribe |