diff options
author | Andy Lo-A-Foe <andy.loafoe@aemian.com> | 2016-01-19 19:41:39 +0100 |
---|---|---|
committer | Andy Lo-A-Foe <andy.loafoe@aemian.com> | 2016-01-19 19:41:39 +0100 |
commit | 6faabe34e8a56e247953be631a6af31a132b8b0b (patch) | |
tree | 4b1d56c22d06669f80b045eb8c7e1f9a7407ea3a /web/react/utils/utils.jsx | |
parent | c672820ff6a2a58d390c9bbc80fffdcc654e2716 (diff) | |
download | chat-6faabe34e8a56e247953be631a6af31a132b8b0b.tar.gz chat-6faabe34e8a56e247953be631a6af31a132b8b0b.tar.bz2 chat-6faabe34e8a56e247953be631a6af31a132b8b0b.zip |
Optionally specify ws:// and wss:// port in config
Diffstat (limited to 'web/react/utils/utils.jsx')
-rw-r--r-- | web/react/utils/utils.jsx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index 24042321f..92ad82739 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -1101,6 +1101,17 @@ export function getFileName(path) { return split[split.length - 1]; } +// Gets the websocket port to use. Configurable on the server. +export function getWebsocketPort(protocol) { + if ((/^wss:/).test(protocol)) { // wss:// + return ':' + global.window.mm_config.WebsocketSecurePort; + } + if ((/^ws:/).test(protocol)) { + return ':' + global.window.mm_config.WebsocketPort; + } + return ''; +} + export function getSessionIndex() { if (global.window.mm_session_token_index >= 0) { return 'session_token_index=' + global.window.mm_session_token_index; |