-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: James M Snell <[email protected]>
- Loading branch information
Showing
27 changed files
with
14,932 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
# QUIC | ||
|
||
## Overview | ||
|
||
## API | ||
|
||
### Class: `net.quic.EndpointConfig` | ||
|
||
#### `new net.quic.EndpointConfig(options)` | ||
|
||
* `options` {Object} | ||
* `address` {Object|net.SocketAddress} Identifies the local IPv4 or IPv6 | ||
address to bind to. | ||
* `address` {string} The network address as either an IPv4 or IPv6 string. | ||
**Default**: `'127.0.0.1'` if `family` is `'ipv4'`; `'::'` if `family` is | ||
`'ipv6'`. | ||
* `family` {string} One of either `'ipv4'` or 'ipv6'`. | ||
**Default**: `'ipv4'`. | ||
* `flowlabel` {number} An IPv6 flow-label used only if `family` is `'ipv6'`. | ||
* `port` {number} An IP port. | ||
* `retryTokenExpiration` {number|bigint} | ||
* `tokenExpiration` {number|bigint} | ||
* `maxWindowOverride` {number|bigint} | ||
* `maxStreamWindowOverride` {number|bigint} | ||
* `maxConnectionsPerHost` {number|bigint} | ||
* `maxConnectionsTotal` {number|bigint} | ||
* `maxStatelessResets` {number|bigint} | ||
* `addressLRUSize` {number|bigint} | ||
* `retryLimit` {number|bigint} | ||
* `maxPayloadSize` {number|bigint} | ||
* `unacknowledgedPacketThreshold` {number|bigint} | ||
* `qlog` {boolean} | ||
* `validateAddress` {boolean} | ||
* `disableStatelessReset` {boolean} | ||
* `rxPacketLoss` {number} | ||
* `txPacketLoss` {number} | ||
* `ccAlgorithm` {string} One of either `'cubic'` or `'reno'`. | ||
* `udp` {Object} | ||
* `ipv6Only` {boolean} | ||
* `receiveBufferSize` {number} | ||
* `sendBufferSize` {number} | ||
* `ttl` {number} | ||
* `resetTokenSecret` {ArrayBuffer|TypedArray|DataView|Buffer} | ||
|
||
### Class: `net.quic.SessionConfig` | ||
|
||
#### `new net.quic.SessionConfig(side, options)` | ||
|
||
* `side` {String} One of `'client'` or `'server'` | ||
* `options` {Object} | ||
* `alpn` {string} | ||
* `dcid` {string|ArrayBuffer|TypedArray|DataView|Buffer} | ||
* `hostname` {string} | ||
* `preferredAddressStrategy` {string} One of `'use'` or `'ignore'` | ||
* `secure` {Object} | ||
* `ca` {string|string[]|Buffer|Buffer[]} | ||
* `cert` {string|string[]|Buffer|Buffer[]} | ||
* `sigalgs` {string} | ||
* `ciphers` {string} | ||
* `clientCertEngine` {string} | ||
* `crl` {string|string[]|Buffer|Buffer[]} | ||
* `dhparam` {string|Buffer} | ||
* `ecdhCurve` {string} | ||
* `key` {string|string[]|Buffer|Buffer[]|Object[]} | ||
* `privateKey` {Object} | ||
* `engine` {string} | ||
* `identifier` {string} | ||
* `passphrase` {string} | ||
* `pfx` {string|string[]|Buffer|Buffer[]|Object[]} | ||
* `secureOptions` | ||
* `sessionIdContext` {string} | ||
* `ticketKeys` {Buffer} | ||
* `sessionTimeout` {number} | ||
* `enableTLSTrace` {boolean} | ||
* `handshakeTimeout` {number} | ||
* `minDHSize` {number} | ||
* `pskCallback` {Function} | ||
* `socket` {tls.TLSSocket} | ||
* `identity` {string} | ||
* Returns: {Buffer|TypedArray|DataView} | ||
* `rejectUnauthorized` {boolean} | ||
* `requestOCSP` {boolean} | ||
* `requestPeerCertificate` {boolean} | ||
* `verifyHostnameIdentity` {boolean} | ||
* `transportParams` {Object} | ||
* `initialMaxStreamDataBidiLocal` {number|bigint} | ||
* `initialMaxStreamDataBidiRemote` {number|bigint} | ||
* `initialMaxStreamDataUni` {number|bigint} | ||
* `initialMaxData` {number|bigint} | ||
* `initialMaxStreamsBidi` {number|bigint} | ||
* `initialMaxStreamsUni` {number|bigint} | ||
* `maxIdleTimeout` {number|bigint} | ||
* `activeConnectionIdLimit` {number|bigint} | ||
* `ackDelayExponent` {number|bigint} | ||
* `maxAckDelay` {number|bigint} | ||
* `maxDatagramFrameSize` {number|bigint} | ||
* `disableActiveMigration` {boolean} | ||
* `preferredAddress` {Object} | ||
* `ipv4` {Object|net.SocketAddress} | ||
* `address` {string} | ||
* `port` {number} | ||
* `ipv6` {Object|net.SocketAddress} | ||
* `address` {string} | ||
* `port` {number} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
'use strict'; | ||
|
||
const { | ||
initializeCallbacks, | ||
} = internalBinding('quic'); | ||
|
||
const { | ||
symbols: { | ||
owner_symbol, | ||
}, | ||
} = require('internal/async_hooks'); | ||
|
||
// If the initializeCallbacks is undefined, the Node.js binary | ||
// was built without QUIC support, in which case we | ||
// don't want to export anything here. | ||
if (initializeCallbacks === undefined) | ||
return; | ||
|
||
// For the list of required callbacks, see the QUIC_JS_CALLBACKS | ||
// macro in src/quic/quic.h | ||
|
||
function onEndpointClose(context, status) {} | ||
|
||
function onEndpointDone() { | ||
this[owner_symbol].destroy(); | ||
} | ||
|
||
function onEndpointError() {} | ||
|
||
function onSessionNew() {} | ||
|
||
function onSessionCert() {} | ||
|
||
function onSessionClientHello() {} | ||
|
||
function onSessionClose() {} | ||
|
||
function onSessionDatagram() {} | ||
|
||
function onSessionHandshake() {} | ||
|
||
function onSessionKeylog() {} | ||
|
||
function onSessionPathValidation() {} | ||
|
||
function onSessionUsePreferredAddress() {} | ||
|
||
function onSessionQlog() {} | ||
|
||
function onSessionOcspRequest() {} | ||
|
||
function onSessionOcspResponse() {} | ||
|
||
function onSessionTicket() {} | ||
|
||
function onSessionVersionNegotiation() {} | ||
|
||
function onStreamClose() {} | ||
|
||
function onStreamError() {} | ||
|
||
function onStreamReady() {} | ||
|
||
function onStreamReset() {} | ||
|
||
function onStreamHeaders() {} | ||
|
||
function onStreamBlocked() {} | ||
|
||
module.exports = { | ||
initializeBinding() { | ||
initializeCallbacks({ | ||
onEndpointClose, | ||
onEndpointDone, | ||
onEndpointError, | ||
onSessionNew, | ||
onSessionCert, | ||
onSessionClientHello, | ||
onSessionClose, | ||
onSessionDatagram, | ||
onSessionHandshake, | ||
onSessionKeylog, | ||
onSessionPathValidation, | ||
onSessionUsePreferredAddress, | ||
onSessionQlog, | ||
onSessionOcspRequest, | ||
onSessionOcspResponse, | ||
onSessionTicket, | ||
onSessionVersionNegotiation, | ||
onStreamClose, | ||
onStreamError, | ||
onStreamReady, | ||
onStreamReset, | ||
onStreamHeaders, | ||
onStreamBlocked, | ||
}); | ||
} | ||
}; |
Oops, something went wrong.