File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ function Server(opts){
36
36
37
37
opts = opts || { } ;
38
38
39
- this . wsEngine = opts . wsEngine || process . env . EIO_WS_ENGINE || 'ws' ;
39
+ this . wsEngine = opts . wsEngine || process . env . EIO_WS_ENGINE ;
40
40
this . pingTimeout = opts . pingTimeout || 60000 ;
41
41
this . pingInterval = opts . pingInterval || 25000 ;
42
42
this . upgradeTimeout = opts . upgradeTimeout || 10000 ;
@@ -70,7 +70,8 @@ function Server(opts){
70
70
71
71
// initialize websocket server
72
72
if ( ~ this . transports . indexOf ( 'websocket' ) ) {
73
- var WebSocketServer = require ( this . wsEngine ) . Server ;
73
+ // keep require('ws') as separate expression for packers (browserify, etc)
74
+ var WebSocketServer = ( this . wsEngine ? require ( this . wsEngine ) : require ( 'ws' ) ) . Server ;
74
75
this . ws = new WebSocketServer ( {
75
76
noServer : true ,
76
77
clientTracking : false ,
You can’t perform that action at this time.
0 commit comments