Closed
Description
Specification
We need a way to provide the connection info and other metadata along side the stream when it is created. The stream itself should implement the RpcStream
interface defined in the agnostic RPC system. This is defined below.
interface RPCStream<
R,
W,
M extends Record<string, JSONValue> = Record<string, JSONValue>,
> extends ReadableWritablePair<R, W> {
cancel: (reason?: any) => void;
meta?: M;
}
This information should be stored within the QUICConnection
and can be taken from there. Certain information such as src address can change, so we need to keep this data up to date.
This also means we need to be able to get the connection information from the underlying QUICConnection
. Features may need to be added to support this.
Metadata we need to include are:
type Metadata = {
remoteCertificates?: Certificates
localHost: Host;
localPort: Port;
remoteHost: Host;
remotePort: Port;
}
Additional context
- Related Create QUIC library that can be exposed to JS and uses the Node
dgram
module #1 - Related Create QUIC library that can be exposed to JS and uses the Node
dgram
module #1 (comment)
Tasks
- Have the streams implement the
RpcStream
interface. - Add any required methods to
QUICConnection
to provide any connection information an other metadata.