diff --git a/ws/ws.d.ts b/ws/ws.d.ts index 2b16bd52ea..2137413251 100644 --- a/ws/ws.d.ts +++ b/ws/ws.d.ts @@ -21,7 +21,7 @@ declare module "ws" { protocolVersion: string; url: string; supports: any; - upgradeReq: http.ServerRequest; + upgradeReq: http.IncomingMessage; protocol: string; CONNECTING: number; @@ -76,8 +76,8 @@ declare module "ws" { namespace WebSocket { - type VerifyClientCallbackSync = (info: {origin: string; secure: boolean; req: http.ServerRequest}) => boolean; - type VerifyClientCallbackAsync = (info: {origin: string; secure: boolean; req: http.ServerRequest} + type VerifyClientCallbackSync = (info: {origin: string; secure: boolean; req: http.IncomingMessage}) => boolean; + type VerifyClientCallbackAsync = (info: {origin: string; secure: boolean; req: http.IncomingMessage} , callback: (res: boolean) => void) => void; export interface IClientOptions { @@ -116,7 +116,7 @@ declare module "ws" { constructor(options?: IServerOptions, callback?: Function); close(cb?: () => {}): void; - handleUpgrade(request: http.ServerRequest, socket: net.Socket, + handleUpgrade(request: http.IncomingMessage, socket: net.Socket, upgradeHead: Buffer, callback: (client: WebSocket) => void): void; // Events