@@ -10,29 +10,29 @@ module.exports = class WebsocketServer extends BaseServer {
10
10
constructor ( server ) {
11
11
super ( server ) ;
12
12
13
- this . wsServer = new ws . Server ( {
13
+ this . webSocketServer = new ws . Server ( {
14
14
noServer : true ,
15
15
path : this . server . options . client . path ,
16
16
} ) ;
17
17
18
18
this . server . server . on ( 'upgrade' , ( req , sock , head ) => {
19
- if ( ! this . wsServer . shouldHandle ( req ) ) {
19
+ if ( ! this . webSocketServer . shouldHandle ( req ) ) {
20
20
return ;
21
21
}
22
22
23
- this . wsServer . handleUpgrade ( req , sock , head , ( connection ) => {
24
- this . wsServer . emit ( 'connection' , connection , req ) ;
23
+ this . webSocketServer . handleUpgrade ( req , sock , head , ( connection ) => {
24
+ this . webSocketServer . emit ( 'connection' , connection , req ) ;
25
25
} ) ;
26
26
} ) ;
27
27
28
- this . wsServer . on ( 'error' , ( err ) => {
28
+ this . webSocketServer . on ( 'error' , ( err ) => {
29
29
this . server . logger . error ( err . message ) ;
30
30
} ) ;
31
31
32
32
const noop = ( ) => { } ;
33
33
34
34
setInterval ( ( ) => {
35
- this . wsServer . clients . forEach ( ( socket ) => {
35
+ this . webSocketServer . clients . forEach ( ( socket ) => {
36
36
if ( socket . isAlive === false ) {
37
37
return socket . terminate ( ) ;
38
38
}
@@ -58,7 +58,7 @@ module.exports = class WebsocketServer extends BaseServer {
58
58
59
59
// f should be passed the resulting connection and the connection headers
60
60
onConnection ( f ) {
61
- this . wsServer . on ( 'connection' , ( connection , req ) => {
61
+ this . webSocketServer . on ( 'connection' , ( connection , req ) => {
62
62
connection . isAlive = true ;
63
63
connection . on ( 'pong' , ( ) => {
64
64
connection . isAlive = true ;
0 commit comments