diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-03-17 15:22:48 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-03-17 15:22:48 -0700 |
commit | 4f0e8c3aed0ce2e4606c5c8facacfbd3c015d375 (patch) | |
tree | 94cdf2df79d6d8ddc428d659eb180555775b8768 /src/settings.js | |
parent | 46bf009284405d352e6c9682829b4e0895b7c17f (diff) | |
parent | 4cc63f3c60ea9cc2e366671cb40de2e929c83244 (diff) |
Merge pull request #2020 from fadams/improve-websocket-config-options
Provide compile time and run time options for WebSocket URL and subproto...
Diffstat (limited to 'src/settings.js')
-rw-r--r-- | src/settings.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/settings.js b/src/settings.js index 1c41676d..6e644a54 100644 --- a/src/settings.js +++ b/src/settings.js @@ -225,6 +225,19 @@ 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 + // RFC 6455 URL - "ws[s]:" "//" host [ ":" port ] path [ "?" query ]. + // 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. |