-
Notifications
You must be signed in to change notification settings - Fork 3.5k
node:net rework #18962
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
node:net rework #18962
Changes from 122 commits
cf2cb63
294c3fa
47415dc
e97be5e
5193024
591248c
ef3a61e
b56edc7
45e0e1b
30b5cbd
6926eea
8ca9a6d
761f981
7e64b50
fb7c418
a7daebd
f899805
0836a30
0b06159
61745b1
579e48c
7945339
5cffa7b
8d7224a
28174dc
b99e5db
0da9a7c
8284a91
fa85b64
b760fbd
81c2d38
80dfd71
95a3a5e
e2fff4a
ac7ac89
b5019a6
418b22b
0193fff
6087a1b
2d7a651
b1aadeb
e4e2700
36c6f26
3ba34ea
351c87e
1fe8f6a
18eee12
5ed4e9e
b2f9cf5
9443527
087b584
83bcac8
ab1b211
f650ba0
262e257
46742d6
0b3ad0c
7695e83
a91c815
0983950
c5bba60
08cec41
8f3d737
fb03052
aa34062
3f8ef98
d40e825
be3219e
82af73a
5e3f335
0217823
794737b
321947f
ceafd58
f45c6c6
3d8e900
4594684
89cc382
14beca8
15d2e31
9d131ff
b0bebf8
23d32a5
be3f96f
2edd2aa
e759354
9b24e25
25e9fb9
b0b606a
fbddcdd
2dc227d
ff31948
91b7026
df42b45
910e9b2
5ce7088
dab5c1e
2a5eb5c
f5667ed
fe1bda5
41e3d09
e0630dc
fbb0c4a
9dbe028
c9d3069
91f18c9
3ef7b46
b60f6d6
9e07091
08200c7
e035f9b
4668d66
ecacf4a
a3b95c6
edbc80d
307f81b
7c2a4c2
0541af5
081fa6c
02e9f06
9e2b893
46f2055
595dd4f
c92af17
3fac122
d733c2c
f774a1e
12d20e7
73dd2c3
2db9101
6a07f7e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3660,7 +3660,7 @@ declare module "bun" { | |
| * the well-known CAs curated by Mozilla. Mozilla's CAs are completely | ||
| * replaced when CAs are explicitly specified using this option. | ||
| */ | ||
| ca?: string | Buffer | BunFile | Array<string | Buffer | BunFile> | undefined; | ||
| ca?: string | BufferSource | BunFile | Array<string | BufferSource | BunFile> | undefined; | ||
| /** | ||
| * Cert chains in PEM format. One cert chain should be provided per | ||
| * private key. Each cert chain should consist of the PEM formatted | ||
|
|
@@ -3672,7 +3672,7 @@ declare module "bun" { | |
| * intermediate certificates are not provided, the peer will not be | ||
| * able to validate the certificate, and the handshake will fail. | ||
| */ | ||
| cert?: string | Buffer | BunFile | Array<string | Buffer | BunFile> | undefined; | ||
| cert?: string | BufferSource | BunFile | Array<string | BufferSource | BunFile> | undefined; | ||
| /** | ||
| * Private keys in PEM format. PEM allows the option of private keys | ||
| * being encrypted. Encrypted keys will be decrypted with | ||
|
|
@@ -3683,13 +3683,25 @@ declare module "bun" { | |
| * object.passphrase is optional. Encrypted keys will be decrypted with | ||
| * object.passphrase if provided, or options.passphrase if it is not. | ||
| */ | ||
| key?: string | Buffer | BunFile | Array<string | Buffer | BunFile> | undefined; | ||
| key?: string | BufferSource | BunFile | Array<string | BufferSource | BunFile> | undefined; | ||
| /** | ||
| * Optionally affect the OpenSSL protocol behavior, which is not | ||
| * usually necessary. This should be used carefully if at all! Value is | ||
| * a numeric bitmask of the SSL_OP_* options from OpenSSL Options | ||
| */ | ||
| secureOptions?: number | undefined; // Value is a numeric bitmask of the `SSL_OP_*` options | ||
| secureOptions?: number; // Value is a numeric bitmask of the `SSL_OP_*` options | ||
|
|
||
| keyFile?: string; | ||
|
|
||
| certFile?: string; | ||
|
|
||
| ALPNProtocols?: string | BufferSource; | ||
|
|
||
| ciphers?: string; | ||
|
|
||
| clientRenegotiationLimit?: number; | ||
|
|
||
| clientRenegotiationWindow?: number; | ||
| } | ||
|
|
||
| // Note for contributors: TLSOptionsAsDeprecated should be considered immutable | ||
|
|
@@ -6022,7 +6034,7 @@ declare module "bun" { | |
| * certificate. | ||
| * @return A certificate object. | ||
| */ | ||
| getPeerCertificate(): import("tls").PeerCertificate; | ||
| getPeerCertificate(): import("node:tls").PeerCertificate; | ||
| getPeerX509Certificate(): import("node:crypto").X509Certificate; | ||
|
|
||
| /** | ||
|
|
@@ -6127,6 +6139,34 @@ declare module "bun" { | |
| * The number of bytes written to the socket. | ||
| */ | ||
| readonly bytesWritten: number; | ||
|
|
||
| resume(): void; | ||
|
|
||
| pause(): void; | ||
|
|
||
| renegotiate(): void; | ||
|
|
||
| setVerifyMode(requestCert: boolean, rejectUnauthorized: boolean): void; | ||
|
|
||
| getSession(): void; | ||
|
|
||
| setSession(session: string | Buffer | BufferSource): void; | ||
|
|
||
| exportKeyingMaterial(length: number, label: string, context?: string | BufferSource): void; | ||
|
|
||
| upgradeTLS<Data>(options: TLSUpgradeOptions<Data>): [raw: Socket<Data>, tls: Socket<Data>]; | ||
|
|
||
| close(): void; | ||
|
|
||
| getServername(): string; | ||
|
|
||
| setServername(name: string): void; | ||
| } | ||
|
|
||
| interface TLSUpgradeOptions<Data> { | ||
| data?: Data; | ||
| tls: TLSOptions | boolean; | ||
| socket: SocketHandler<Data>; | ||
| } | ||
|
|
||
| interface SocketListener<Data = undefined> extends Disposable { | ||
|
|
@@ -6227,6 +6267,22 @@ declare module "bun" { | |
| * The per-instance data context | ||
| */ | ||
| data?: Data; | ||
| /** | ||
| * Whether to allow half-open connections. | ||
| * | ||
| * A half-open connection occurs when one end of the connection has called `close()` | ||
| * or sent a FIN packet, while the other end remains open. When set to `true`: | ||
| * | ||
| * - The socket won't automatically send FIN when the remote side closes its end | ||
| * - The local side can continue sending data even after the remote side has closed | ||
| * - The application must explicitly call `end()` to fully close the connection | ||
| * | ||
| * When `false`, the socket automatically closes both ends of the connection when | ||
| * either side closes. | ||
| * | ||
| * @default false | ||
| */ | ||
| allowHalfOpen?: boolean; | ||
| } | ||
|
|
||
| interface TCPSocketListenOptions<Data = undefined> extends SocketOptions<Data> { | ||
|
|
@@ -6241,7 +6297,7 @@ declare module "bun" { | |
| /** | ||
| * The TLS configuration object with which to create the server | ||
| */ | ||
| tls?: TLSOptions; | ||
| tls?: TLSOptions | boolean; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add to JSDoc why |
||
| /** | ||
| * Whether to use exclusive mode. | ||
| * | ||
|
|
@@ -6287,7 +6343,7 @@ declare module "bun" { | |
| /** | ||
| * TLS Configuration with which to create the socket | ||
| */ | ||
| tls?: boolean; | ||
| tls?: TLSOptions | boolean; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add to JSDoc why |
||
| /** | ||
| * Whether to use exclusive mode. | ||
| * | ||
|
|
@@ -6303,22 +6359,8 @@ declare module "bun" { | |
| * @default false | ||
| */ | ||
| exclusive?: boolean; | ||
| /** | ||
| * Whether to allow half-open connections. | ||
| * | ||
| * A half-open connection occurs when one end of the connection has called `close()` | ||
| * or sent a FIN packet, while the other end remains open. When set to `true`: | ||
| * | ||
| * - The socket won't automatically send FIN when the remote side closes its end | ||
| * - The local side can continue sending data even after the remote side has closed | ||
| * - The application must explicitly call `end()` to fully close the connection | ||
| * | ||
| * When `false` (default), the socket automatically closes both ends of the connection | ||
| * when either side closes. | ||
| * | ||
| * @default false | ||
| */ | ||
| allowHalfOpen?: boolean; | ||
| reusePort?: boolean; | ||
| ipv6Only?: boolean; | ||
| } | ||
|
|
||
| interface UnixSocketOptions<Data = undefined> extends SocketOptions<Data> { | ||
|
|
@@ -6329,14 +6371,14 @@ declare module "bun" { | |
| /** | ||
| * TLS Configuration with which to create the socket | ||
| */ | ||
| tls?: TLSOptions; | ||
| tls?: TLSOptions | boolean; | ||
| } | ||
|
|
||
| interface FdSocketOptions<Data = undefined> extends SocketOptions<Data> { | ||
| /** | ||
| * TLS Configuration with which to create the socket | ||
| */ | ||
| tls?: TLSOptions; | ||
| tls?: TLSOptions | boolean; | ||
| /** | ||
| * The file descriptor to connect to | ||
| */ | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.