diff --git a/web/js/Server.js b/web/js/Server.js index 7d03bd155..61109805d 100644 --- a/web/js/Server.js +++ b/web/js/Server.js @@ -49,7 +49,7 @@ var Server = function() { const path = (this.PathToApi && (this.PathToApi != 'null')) ? this.PathToApi : ''; // Single-server: match browser's host:port (this.Hostname/Port may be wrong behind a proxy). if (!this.Id) { - return protocol + '//' + location.host + path; + return protocol + '//' + (port ? location.hostname + ':' + port : location.host) + path; } return protocol + '//' + this.Hostname + (port ? ':' + port : (this.Port ? ':' + this.Port : (location.port ? ':' + location.port : ''))) + path; }