File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ var qs = require('querystring')
11
11
, transports = require ( './transports' )
12
12
, EventEmitter = require ( 'events' ) . EventEmitter
13
13
, Socket = require ( './socket' )
14
- , WebSocketServer = require ( 'ws' ) . Server
15
14
, debug = require ( 'debug' ) ( 'engine' ) ;
16
15
17
16
/**
@@ -36,6 +35,8 @@ function Server(opts){
36
35
this . clientsCount = 0 ;
37
36
38
37
opts = opts || { } ;
38
+
39
+ this . wsEngine = opts . wsEngine || process . env . EIO_WS_ENGINE || 'ws' ;
39
40
this . pingTimeout = opts . pingTimeout || 60000 ;
40
41
this . pingInterval = opts . pingInterval || 25000 ;
41
42
this . upgradeTimeout = opts . upgradeTimeout || 10000 ;
@@ -69,6 +70,7 @@ function Server(opts){
69
70
70
71
// initialize websocket server
71
72
if ( ~ this . transports . indexOf ( 'websocket' ) ) {
73
+ var WebSocketServer = require ( this . wsEngine ) . Server ;
72
74
this . ws = new WebSocketServer ( {
73
75
noServer : true ,
74
76
clientTracking : false ,
You can’t perform that action at this time.
0 commit comments