summaryrefslogtreecommitdiffstats
path: root/web/react/utils/utils.jsx
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2016-01-21 10:01:15 -0500
committerChristopher Speller <crspeller@gmail.com>2016-01-21 10:01:15 -0500
commitc7faefbedcf540e938ab79e498ca86fabc967c5b (patch)
tree731262af8f8ff916a3e0d9260864804c0aaf84af /web/react/utils/utils.jsx
parent868eece9879131e9f2093a0e858533c9df76b55c (diff)
parentff8df5bf7d45ddd39df8b265ed6af07bd3932d55 (diff)
downloadchat-c7faefbedcf540e938ab79e498ca86fabc967c5b.tar.gz
chat-c7faefbedcf540e938ab79e498ca86fabc967c5b.tar.bz2
chat-c7faefbedcf540e938ab79e498ca86fabc967c5b.zip
Merge pull request #1924 from loafoe/master
[#1923] Make Websocket ports configurable
Diffstat (limited to 'web/react/utils/utils.jsx')
-rw-r--r--web/react/utils/utils.jsx11
1 files changed, 11 insertions, 0 deletions
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx
index 32373b4a3..71fd0852b 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;