Changeset - r25457:3876e5f0edbe
[Not reviewed]
master
0 1 0
embeddedt - 3 years ago 2021-05-13 08:13:34
42941056+embeddedt@users.noreply.github.com
Fix: [Emscripten] Force secure WebSockets over HTTPS (#9248)
1 file changed with 9 insertions and 1 deletions:
0 comments (0 inline, 0 general)
os/emscripten/pre.js
Show inline comments
 
@@ -9,7 +9,15 @@ Module['websocket'] = { url: function(ho
 
     * If you run your own server you can setup your own WebSocket proxy in
 
     * front of it and let people connect to your server via the proxy. You
 
     * are best to add another "if" statement as above for this. */
 
    return null;
 

	
 
    if (location.protocol === 'https:') {
 
        /* Insecure WebSockets do not work over HTTPS, so we force
 
         * secure ones. */
 
        return 'wss://';
 
    } else {
 
        /* Use the default provided by Emscripten. */
 
        return null;
 
    }
 
} };
 

	
 
Module.preRun.push(function() {
0 comments (0 inline, 0 general)