File tree Expand file tree Collapse file tree 4 files changed +8
-0
lines changed
Expand file tree Collapse file tree 4 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import {
1010 Server as HTTPServer ,
1111} from "http" ;
1212import { Server as HTTPSServer } from "https" ;
13+ import { createConnection } from "net" ;
1314import { Duplex , DuplexOptions } from "stream" ;
1415import { SecureContextOptions } from "tls" ;
1516import { URL } from "url" ;
@@ -257,6 +258,7 @@ declare namespace WebSocket {
257258 autoPong ?: boolean | undefined ;
258259 maxPayload ?: number | undefined ;
259260 skipUTF8Validation ?: boolean | undefined ;
261+ createConnection ?: typeof createConnection | undefined ;
260262 finishRequest ?: FinishRequestCallback | undefined ;
261263 }
262264
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import {
1010 Server as HTTPServer ,
1111} from "http" ;
1212import { Server as HTTPSServer } from "https" ;
13+ import { createConnection } from "net" ;
1314import { Duplex , DuplexOptions } from "stream" ;
1415import { SecureContextOptions } from "tls" ;
1516import { URL } from "url" ;
@@ -260,6 +261,7 @@ declare namespace WebSocket {
260261 autoPong ?: boolean | undefined ;
261262 maxPayload ?: number | undefined ;
262263 skipUTF8Validation ?: boolean | undefined ;
264+ createConnection ?: typeof createConnection | undefined ;
263265 finishRequest ?: FinishRequestCallback | undefined ;
264266 }
265267
Original file line number Diff line number Diff line change 11import * as http from "http" ;
22import * as https from "https" ;
3+ import * as net from "net" ;
34import * as url from "url" ;
45import WebSocket from "ws" ;
56// eslint-disable-next-line no-duplicate-imports
@@ -528,6 +529,7 @@ declare module "ws" {
528529 const ws = new WebSocket ( "ws://www.host.com/path" , {
529530 allowSynchronousEvents : false ,
530531 autoPong : false ,
532+ createConnection : net . createConnection ,
531533 finishRequest : ( req , socket ) => {
532534 // $ExpectType IncomingMessage
533535 req ;
Original file line number Diff line number Diff line change 11import WebSocket = require( "ws" ) ;
22import * as http from "http" ;
33import * as https from "https" ;
4+ import * as net from "net" ;
45import * as url from "url" ;
56import * as wslib from "ws" ;
67
@@ -520,6 +521,7 @@ declare module "ws" {
520521 const ws = new WebSocket ( "ws://www.host.com/path" , {
521522 allowSynchronousEvents : false ,
522523 autoPong : false ,
524+ createConnection : net . createConnection ,
523525 finishRequest : ( req , socket ) => {
524526 // $ExpectType IncomingMessage
525527 req ;
You can’t perform that action at this time.
0 commit comments