File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -18,16 +18,16 @@ KoaWebSocketServer.prototype.listen = function (options) {
18
18
this . server . on ( 'connection' , this . onConnection . bind ( this ) ) ;
19
19
} ;
20
20
21
- KoaWebSocketServer . prototype . onConnection = function ( socket ) {
21
+ KoaWebSocketServer . prototype . onConnection = function ( socket , request ) {
22
22
debug ( 'Connection received' ) ;
23
23
socket . on ( 'error' , function ( err ) {
24
24
debug ( 'Error occurred:' , err ) ;
25
25
} ) ;
26
26
const fn = co . wrap ( compose ( this . middleware ) ) ;
27
27
28
- const context = this . app . createContext ( socket . upgradeReq ) ;
28
+ const context = this . app . createContext ( request ) ;
29
29
context . websocket = socket ;
30
- context . path = url . parse ( socket . upgradeReq . url ) . pathname ;
30
+ context . path = url . parse ( request . url ) . pathname ;
31
31
32
32
fn ( context ) . catch ( function ( err ) {
33
33
debug ( err ) ;
You can’t perform that action at this time.
0 commit comments