Skip to content

Propagate connection info along side stream creation #16

Closed
@tegefaulkes

Description

@tegefaulkes

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

Tasks

  1. Have the streams implement the RpcStream interface.
  2. Add any required methods to QUICConnection to provide any connection information an other metadata.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions