File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 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) {
1818 this . server . on ( 'connection' , this . onConnection . bind ( this ) ) ;
1919} ;
2020
21- KoaWebSocketServer . prototype . onConnection = function ( socket ) {
21+ KoaWebSocketServer . prototype . onConnection = function ( socket , request ) {
2222 debug ( 'Connection received' ) ;
2323 socket . on ( 'error' , function ( err ) {
2424 debug ( 'Error occurred:' , err ) ;
2525 } ) ;
2626 const fn = co . wrap ( compose ( this . middleware ) ) ;
2727
28- const context = this . app . createContext ( socket . upgradeReq ) ;
28+ const context = this . app . createContext ( request ) ;
2929 context . websocket = socket ;
30- context . path = url . parse ( socket . upgradeReq . url ) . pathname ;
30+ context . path = url . parse ( request . url ) . pathname ;
3131
3232 fn ( context ) . catch ( function ( err ) {
3333 debug ( err ) ;
You can’t perform that action at this time.
0 commit comments