diff options
-rw-r--r-- | src/library_sockfs.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/library_sockfs.js b/src/library_sockfs.js index c79661d8..78fc382f 100644 --- a/src/library_sockfs.js +++ b/src/library_sockfs.js @@ -140,7 +140,7 @@ mergeInto(LibraryManager.library, { // the node ws library API is slightly different than the browser's var opts = ENVIRONMENT_IS_NODE ? {headers: {'websocket-protocol': ['binary']}} : ['binary']; // If node we use the ws library. - var WebSocket = ENVIRONMENT_IS_NODE ? require('ws') : window.WebSocket; + var WebSocket = ENVIRONMENT_IS_NODE ? require('ws') : window['WebSocket']; ws = new WebSocket(url, opts); ws.binaryType = 'arraybuffer'; } catch (e) { |