aboutsummaryrefslogtreecommitdiff
path: root/src/settings.js
diff options
context:
space:
mode:
authorFraser Adams <fraser.adams@blueyonder.co.uk>2014-01-15 17:13:59 +0000
committerFraser Adams <fraser.adams@blueyonder.co.uk>2014-01-15 17:13:59 +0000
commit43ee264bab811099b3a6581f2ae87d501675a4e7 (patch)
treeb16fed20293ad8ff5276a6d1d77702aff27082f6 /src/settings.js
parent899b2b41e696ff627ee9b8690d9ef8ba04e73df3 (diff)
Provide compile time and run time options for WebSocket URL and subprotocol fields
Diffstat (limited to 'src/settings.js')
-rw-r--r--src/settings.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/settings.js b/src/settings.js
index 720fb53f..93f141ba 100644
--- a/src/settings.js
+++ b/src/settings.js
@@ -216,6 +216,18 @@ var LIBRARY_DEBUG = 0; // Print out when we enter a library call (library*.js).
var SOCKET_DEBUG = 0; // Log out socket/network data transfer.
var SOCKET_WEBRTC = 0; // Select socket backend, either webrtc or websockets.
+// As well as being configurable at compile time via the "-s" option the WEBSOCKET_URL and WEBSOCKET_SUBPROTOCOL
+// settings may configured at run time via the Module object e.g.
+// Module['websocket'] = {subprotocol: 'base64, binary, text'};
+// Module['websocket'] = {url: 'wss://', subprotocol: 'base64'};
+// Run time configuration may be useful as it lets an application select multiple different services.
+var WEBSOCKET_URL = 'ws://'; // A string containing either a WebSocket URL prefix (ws:// or wss://) or a complete URL.
+ // In the (default) case of only a prefix being specified the URL will be constructed from
+ // prefix + addr + ':' + port
+ // where addr and port are derived from the socket connect/bind/accept calls.
+var WEBSOCKET_SUBPROTOCOL = 'binary'; // A string containing a comma separated list of WebSocket subprotocols
+ // as would be present in the Sec-WebSocket-Protocol header.
+
var OPENAL_DEBUG = 0; // Print out debugging information from our OpenAL implementation.
var GL_ASSERTIONS = 0; // Adds extra checks for error situations in the GL library. Can impact performance.