WebTransportSessionRequest Class

A WebTransport CONNECT request a WebTransportListener received: accept or reject it.

public sealed class WebTransportSessionRequest

Properties

NameDescription
AuthorityGets the :authority of the request: the host and the port.
HeadersGets the headers of the request, without the pseudo-headers.
OriginGets the value of the origin header, if any.
PathGets the :path of the request: the path and the query.
ProtocolsGets the application protocols the client offers (wt-available-protocols).
RemoteEndPointGets the address of the client.

Gets the :authority of the request: the host and the port.

public string Authority { get; }

Property value

string

Gets the headers of the request, without the pseudo-headers.

public IReadOnlyList<KeyValuePair<string, string>> Headers { get; }

Gets the value of the origin header, if any.

public string? Origin { get; }

Property value

string?

Gets the :path of the request: the path and the query.

public string Path { get; }

Property value

string

Gets the application protocols the client offers (wt-available-protocols).

public IReadOnlyList<string> Protocols { get; }

Property value

IReadOnlyList<string>

Gets the address of the client.

public IPEndPoint? RemoteEndPoint { get; }

Property value

IPEndPoint?

Methods

NameDescription
AcceptAsync(string?, IEnumerable<KeyValuePair<string, string>>?, CancellationToken)Accepts the session with a 200 response.
RejectAsync(int, IEnumerable<KeyValuePair<string, string>>?, CancellationToken)Rejects the session.

AcceptAsync(string?, IEnumerable<KeyValuePair<string, string>>?, CancellationToken)

WebTransportSessionRequest.cs

Accepts the session with a 200 response.

net10.0

public ValueTask<WebTransportSession> AcceptAsync(string? protocol = null, IEnumerable<KeyValuePair<string, string>>? headers = null, CancellationToken cancellationToken = default)

net11.0

public ValueTask<WebTransportSession> AcceptAsync(string? protocol = null, IEnumerable<KeyValuePair<string, string>>? headers = null, CancellationToken cancellationToken = default)

Parameters

protocol string?
The application protocol picked from WebTransportSessionRequest.Protocols, sent in wt-protocol.
headers IEnumerable<KeyValuePair<string, string>>?
Additional response headers.
cancellationToken CancellationToken
The token to cancel the operation.

Returns

ValueTask<WebTransportSession>

RejectAsync(int, IEnumerable<KeyValuePair<string, string>>?, CancellationToken)

WebTransportSessionRequest.cs

Rejects the session.

net10.0

public ValueTask RejectAsync(int statusCode = 404, IEnumerable<KeyValuePair<string, string>>? headers = null, CancellationToken cancellationToken = default)

net11.0

public ValueTask RejectAsync(int statusCode = 404, IEnumerable<KeyValuePair<string, string>>? headers = null, CancellationToken cancellationToken = default)

Parameters

statusCode int
The HTTP status code, outside 200-299.
headers IEnumerable<KeyValuePair<string, string>>?
Additional response headers.
cancellationToken CancellationToken
The token to cancel the operation.

Returns

ValueTask