From 8b40dc9d196429cabb02142ce6093c993eacc00c Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Thu, 27 Jul 2017 14:02:50 +0100 Subject: [PATCH] Fix websockets on other ports than 80 Former-commit-id: 92fc9e1bd2c7590af98c5246a7e035a3ca8f3d6f [formerly 3cbab224088f675ab9474a78682db7956f90a39e] [formerly 395d28fc36802680a6a30065cad749101c256753 [formerly 736e7d6167a55da815b6d2ae751d36c3cbcc083e]] Former-commit-id: 5cfac7b10ccaf36c3969164df5af8dee4a27a9a5 [formerly 8e8283eba1ae1c5bf0da72927a775fdac2e3ef79] Former-commit-id: 9a89cbe037984be71de125da051a92aa0d1636ab --- assets/src/utils/api.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/src/utils/api.js b/assets/src/utils/api.js index 6a47e3b8..e9b74f48 100644 --- a/assets/src/utils/api.js +++ b/assets/src/utils/api.js @@ -163,7 +163,7 @@ function checksum (url, algo) { function command (url, command, onmessage, onclose) { let protocol = (ssl ? 'wss:' : 'ws:') url = removePrefix(url) - url = `${protocol}//${window.location.hostname}${store.state.baseURL}/api/command${url}` + url = `${protocol}//${window.location.host}${store.state.baseURL}/api/command${url}` let conn = new window.WebSocket(url) conn.onopen = () => conn.send(command) @@ -174,7 +174,7 @@ function command (url, command, onmessage, onclose) { function search (url, search, onmessage, onclose) { let protocol = (ssl ? 'wss:' : 'ws:') url = removePrefix(url) - url = `${protocol}//${window.location.hostname}${store.state.baseURL}/api/search${url}` + url = `${protocol}//${window.location.host}${store.state.baseURL}/api/search${url}` let conn = new window.WebSocket(url) conn.onopen = () => conn.send(search)