File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
src/reactive-rpc/server/http1 Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ export interface WsEndpointDefinition {
4646 maxIncomingMessage ?: number ;
4747 maxOutgoingBackpressure ?: number ;
4848 onUpgrade ?( req : http . IncomingMessage , connection : WsServerConnection ) : void ;
49- onConnect ( ctx : WsConnectionContext , req : http . IncomingMessage ) : void ;
49+ handler ( ctx : WsConnectionContext , req : http . IncomingMessage ) : void ;
5050}
5151
5252export interface Http1ServerOpts {
@@ -174,8 +174,7 @@ export class Http1Server implements Printable {
174174 path = url . slice ( 0 , queryStartIndex ) ;
175175 query = url . slice ( queryStartIndex + 1 ) ;
176176 }
177- const route = ( req . method || '' ) + path ;
178- const match = this . wsMatcher ( route ) ;
177+ const match = this . wsMatcher ( path ) ;
179178 if ( ! match ) {
180179 socket . end ( ) ;
181180 return ;
@@ -213,7 +212,7 @@ export class Http1Server implements Printable {
213212 const secWebSocketProtocol = headers [ 'sec-websocket-protocol' ] ?? '' ;
214213 if ( typeof secWebSocketProtocol === 'string' ) setCodecs ( ctx , secWebSocketProtocol , codecs ) ;
215214 }
216- def . onConnect ( ctx , req ) ;
215+ def . handler ( ctx , req ) ;
217216 } ;
218217
219218 public ws ( def : WsEndpointDefinition ) : void {
Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ export class RpcServer implements Printable {
132132 path,
133133 maxIncomingMessage : 2 * 1024 * 1024 ,
134134 maxOutgoingBackpressure : 2 * 1024 * 1024 ,
135- onConnect : ( ctx : WsConnectionContext , req : http . IncomingMessage ) => {
135+ handler : ( ctx : WsConnectionContext , req : http . IncomingMessage ) => {
136136 const connection = ctx . connection ;
137137 const reqCodec = ctx . reqCodec ;
138138 const resCodec = ctx . resCodec ;
You can’t perform that action at this time.
0 commit comments