diff --git a/dashboard-ui/connectlogin.html b/dashboard-ui/connectlogin.html
index d44f4febe1..c5e7b33dc2 100644
--- a/dashboard-ui/connectlogin.html
+++ b/dashboard-ui/connectlogin.html
@@ -20,6 +20,9 @@
+
+ ${ButtonForgotPassword}
+
${HeaderNewUsers}
diff --git a/dashboard-ui/scripts/connectlogin.js b/dashboard-ui/scripts/connectlogin.js
index 9995643b9e..57d7305099 100644
--- a/dashboard-ui/scripts/connectlogin.js
+++ b/dashboard-ui/scripts/connectlogin.js
@@ -37,6 +37,7 @@
}).done(function (result) {
+ Dashboard.serverAddress(server.Url);
Dashboard.setCurrentUser(result.LocalUserId, result.AccessToken);
window.location = 'index.html';
diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js
index c2f777e8f6..3e6f0b12d4 100644
--- a/dashboard-ui/scripts/site.js
+++ b/dashboard-ui/scripts/site.js
@@ -100,6 +100,9 @@ var Dashboard = {
serverAddress: function (val) {
if (val != null) {
+
+ console.log('Setting server address to: ' + val);
+
store.setItem('serverAddress', val);
}
@@ -776,15 +779,7 @@ var Dashboard = {
return;
}
- var location = window.location;
-
- var webSocketUrl = "ws://" + location.hostname;
-
- if (location.port) {
- webSocketUrl += ':' + location.port;
- }
-
- ApiClient.openWebSocket(webSocketUrl);
+ ApiClient.openWebSocket();
},
onWebSocketOpened: function () {
diff --git a/dashboard-ui/thirdparty/apiclient/mediabrowser.apiclient.js b/dashboard-ui/thirdparty/apiclient/mediabrowser.apiclient.js
index 4eb3a56f0b..08f8720250 100644
--- a/dashboard-ui/thirdparty/apiclient/mediabrowser.apiclient.js
+++ b/dashboard-ui/thirdparty/apiclient/mediabrowser.apiclient.js
@@ -67,6 +67,12 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
throw new Error("Must supply a serverAddress");
}
+ console.log('ApiClient serverAddress: ' + serverAddress);
+ console.log('ApiClient clientName: ' + clientName);
+ console.log('ApiClient applicationVersion: ' + applicationVersion);
+ console.log('ApiClient deviceName: ' + deviceName);
+ console.log('ApiClient deviceId: ' + deviceId);
+
var self = this;
var currentUserId;
var accessToken;
@@ -181,9 +187,11 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
return url;
};
- self.openWebSocket = function (webSocketAddress) {
+ self.openWebSocket = function () {
- var url = webSocketAddress + self.apiPrefix();
+ var url = serverAddress + self.apiPrefix();
+
+ url = url.replace('http', 'ws');
webSocket = new WebSocket(url);