1- import { ConnInfo , getLogger , Handler } from "../../../deps.ts" ;
1+ import { getLogger } from "../../../deps.ts" ;
22import { EventEmitter } from "../../event-emitter/mod.ts" ;
33import { Socket } from "./socket.ts" ;
44import { Polling } from "./transports/polling.ts" ;
@@ -41,7 +41,7 @@ export interface ServerOptions {
4141 */
4242 allowRequest ?: (
4343 req : Request ,
44- connInfo : ConnInfo ,
44+ connInfo : Deno . ServeHandlerInfo ,
4545 ) => Promise < void > ;
4646 /**
4747 * The options related to Cross-Origin Resource Sharing (CORS)
@@ -53,15 +53,15 @@ export interface ServerOptions {
5353 editHandshakeHeaders ?: (
5454 responseHeaders : Headers ,
5555 req : Request ,
56- connInfo : ConnInfo ,
56+ connInfo : Deno . ServeHandlerInfo ,
5757 ) => void | Promise < void > ;
5858 /**
5959 * A function that allows to edit the response headers of all requests
6060 */
6161 editResponseHeaders ?: (
6262 responseHeaders : Headers ,
6363 req : Request ,
64- connInfo : ConnInfo ,
64+ connInfo : Deno . ServeHandlerInfo ,
6565 ) => void | Promise < void > ;
6666}
6767
@@ -73,7 +73,7 @@ interface ConnectionError {
7373}
7474
7575interface ServerReservedEvents {
76- connection : ( socket : Socket , request : Request , connInfo : ConnInfo ) => void ;
76+ connection : ( socket : Socket , request : Request , connInfo : Deno . ServeHandlerInfo ) => void ;
7777 connection_error : ( err : ConnectionError ) => void ;
7878}
7979
@@ -124,8 +124,8 @@ export class Server extends EventEmitter<
124124 *
125125 * @param additionalHandler - another handler which will receive the request if the path does not match
126126 */
127- public handler ( additionalHandler ?: Handler ) {
128- return ( req : Request , connInfo : ConnInfo ) : Response | Promise < Response > => {
127+ public handler ( additionalHandler ?: Deno . ServeHandler ) {
128+ return ( req : Request , connInfo : Deno . ServeHandlerInfo ) : Response | Promise < Response > => {
129129 const url = new URL ( req . url ) ;
130130 if ( url . pathname === this . opts . path ) {
131131 return this . handleRequest ( req , connInfo , url ) ;
@@ -147,7 +147,7 @@ export class Server extends EventEmitter<
147147 */
148148 private async handleRequest (
149149 req : Request ,
150- connInfo : ConnInfo ,
150+ connInfo : Deno . ServeHandlerInfo ,
151151 url : URL ,
152152 ) : Promise < Response > {
153153 getLogger ( "engine.io" ) . debug ( `[server] handling ${ req . method } ${ req . url } ` ) ;
@@ -321,7 +321,7 @@ export class Server extends EventEmitter<
321321 */
322322 private async handshake (
323323 req : Request ,
324- connInfo : ConnInfo ,
324+ connInfo : Deno . ServeHandlerInfo ,
325325 responseHeaders : Headers ,
326326 ) : Promise < Response > {
327327 const id = generateId ( ) ;
0 commit comments