package webtransport

Import Path
	github.com/quic-go/webtransport-go (on go.dev)

Dependency Relation
	imports 20 packages, and imported by one package


Package-Level Type Names (total 11)
/* sort by: | */
ApplicationProtocols is a list of application protocols that can be negotiated, see section 3.3 of https://www.ietf.org/archive/id/draft-ietf-webtrans-http3-14 for details. DialAddr is the function used to dial the underlying QUIC connection. If unset, quic.DialAddrEarly will be used. QUICConfig is the QUIC config used when dialing the QUIC connection. StreamReorderingTime is the time an incoming WebTransport stream that cannot be associated with a session is buffered. This can happen if the response to a CONNECT request (that creates a new session) is reordered, and arrives after the first WebTransport stream(s) for that session. Defaults to 5 seconds. TLSClientConfig is the TLS client config used when dialing the QUIC connection. It must set the h3 ALPN. (*Dialer) Close() error (*Dialer) Dial(ctx context.Context, urlStr string, reqHdr http.Header) (*http.Response, *Session, error) *Dialer : github.com/prometheus/common/expfmt.Closer *Dialer : io.Closer
A ReceiveStream is a unidirectional WebTransport receive stream. CancelRead aborts receiving on this stream. It instructs the peer to stop transmitting stream data. Read will unblock immediately, and future Read calls will fail. When called multiple times it is a no-op. Read reads data from the stream. Read can be made to time out using [ReceiveStream.SetReadDeadline]. If the stream was canceled, the error is a [StreamError]. SetReadDeadline sets the deadline for future Read calls and any currently-blocked Read call. A zero value for t means Read will not time out. *ReceiveStream : github.com/pion/datachannel.ReadDeadliner *ReceiveStream : io.Reader func (*Session).AcceptUniStream(ctx context.Context) (*ReceiveStream, error)
A SendStream is a unidirectional WebTransport send stream. CancelWrite aborts sending on this stream. Data already written, but not yet delivered to the peer is not guaranteed to be delivered reliably. Write will unblock immediately, and future calls to Write will fail. When called multiple times it is a no-op. Close closes the write-direction of the stream. Future calls to Write are not permitted after calling Close. The Context is canceled as soon as the write-side of the stream is closed. This happens when Close() or CancelWrite() is called, or when the peer cancels the read-side of their stream. The cancellation cause is set to the error that caused the stream to close, or `context.Canceled` in case the stream is closed without error. SetWriteDeadline sets the deadline for future Write calls and any currently-blocked Write call. Even if write times out, it may return n > 0, indicating that some data was successfully written. A zero value for t means Write will not time out. Write writes data to the stream. Write can be made to time out using [SendStream.SetWriteDeadline]. If the stream was canceled, the error is a [StreamError]. *SendStream : github.com/miekg/dns.Writer *SendStream : github.com/pion/datachannel.WriteDeadliner *SendStream : github.com/prometheus/common/expfmt.Closer *SendStream : internal/bisect.Writer *SendStream : io.Closer *SendStream : io.WriteCloser *SendStream : io.Writer func (*Session).OpenUniStream() (*SendStream, error) func (*Session).OpenUniStreamSync(ctx context.Context) (str *SendStream, err error)
ApplicationProtocols is a list of application protocols that can be negotiated, see section 3.3 of https://www.ietf.org/archive/id/draft-ietf-webtrans-http3-14 for details. CheckOrigin is used to validate the request origin, thereby preventing cross-site request forgery. CheckOrigin returns true if the request Origin header is acceptable. If unset, a safe default is used: If the Origin header is set, it is checked that it matches the request's Host header. H3 *http3.Server ReorderingTimeout is the maximum time an incoming WebTransport stream that cannot be associated with a session is buffered. It is also the maximum time a WebTransport connection request is blocked waiting for the client's SETTINGS are received. This can happen if the CONNECT request (that creates a new session) is reordered, and arrives after the first WebTransport stream(s) for that session. Defaults to 5 seconds. (*Server) Close() error (*Server) ListenAndServe() error (*Server) ListenAndServeTLS(certFile, keyFile string) error (*Server) Serve(conn net.PacketConn) error ServeQUICConn serves a single QUIC connection. (*Server) Upgrade(w http.ResponseWriter, r *http.Request) (*Session, error) *Server : github.com/prometheus/common/expfmt.Closer *Server : io.Closer
(*Session) AcceptStream(ctx context.Context) (*Stream, error) (*Session) AcceptUniStream(ctx context.Context) (*ReceiveStream, error) (*Session) CloseWithError(code SessionErrorCode, msg string) error Context returns a context that is closed when the session is closed. (*Session) LocalAddr() net.Addr (*Session) OpenStream() (*Stream, error) (*Session) OpenStreamSync(ctx context.Context) (*Stream, error) (*Session) OpenUniStream() (*SendStream, error) (*Session) OpenUniStreamSync(ctx context.Context) (str *SendStream, err error) (*Session) ReceiveDatagram(ctx context.Context) ([]byte, error) (*Session) RemoteAddr() net.Addr (*Session) SendDatagram(b []byte) error SessionState returns the current state of the session func (*Dialer).Dial(ctx context.Context, urlStr string, reqHdr http.Header) (*http.Response, *Session, error) func (*Server).Upgrade(w http.ResponseWriter, r *http.Request) (*Session, error)
SessionError is a WebTransport connection error. ErrorCode SessionErrorCode Message string Remote bool (*SessionError) Error() string (*SessionError) Is(target error) bool *SessionError : error
SessionErrorCode is an error code for session termination. func (*Session).CloseWithError(code SessionErrorCode, msg string) error
SessionState contains the state of a WebTransport session ApplicationProtocol contains the application protocol negotiated for the session ConnectionState contains the QUIC connection state, including TLS handshake information func (*Session).SessionState() SessionState
Stream is a bidirectional WebTransport stream. CancelRead aborts receiving on this stream. See [ReceiveStream.CancelRead] for more details. CancelWrite aborts sending on this stream. See [SendStream.CancelWrite] for more details. Close closes the send-direction of the stream. It does not close the receive-direction of the stream. The Context is canceled as soon as the write-side of the stream is closed. See [SendStream.Context] for more details. Read reads data from the stream. Read can be made to time out using [Stream.SetReadDeadline] and [Stream.SetDeadline]. If the stream was canceled, the error is a [StreamError]. SetDeadline sets the read and write deadlines associated with the stream. It is equivalent to calling both SetReadDeadline and SetWriteDeadline. SetReadDeadline sets the deadline for future Read calls. See [ReceiveStream.SetReadDeadline] for more details. SetWriteDeadline sets the deadline for future Write calls. See [SendStream.SetWriteDeadline] for more details. Write writes data to the stream. Write can be made to time out using [Stream.SetWriteDeadline] or [Stream.SetDeadline]. If the stream was canceled, the error is a [StreamError]. *Stream : github.com/miekg/dns.Writer *Stream : github.com/pion/datachannel.ReadDeadliner *Stream : github.com/pion/datachannel.WriteDeadliner *Stream : github.com/pion/stun.Connection *Stream : github.com/pion/stun/v3.Connection *Stream : github.com/prometheus/common/expfmt.Closer *Stream : internal/bisect.Writer *Stream : io.Closer *Stream : io.ReadCloser *Stream : io.Reader *Stream : io.ReadWriteCloser *Stream : io.ReadWriter *Stream : io.WriteCloser *Stream : io.Writer func (*Session).AcceptStream(ctx context.Context) (*Stream, error) func (*Session).OpenStream() (*Stream, error) func (*Session).OpenStreamSync(ctx context.Context) (*Stream, error)
StreamError is the error that is returned from stream operations (Read, Write) when the stream is canceled. ErrorCode StreamErrorCode Remote bool (*StreamError) Error() string (*StreamError) Is(target error) bool *StreamError : error
StreamErrorCode is an error code used for stream termination. func (*ReceiveStream).CancelRead(e StreamErrorCode) func (*SendStream).CancelWrite(e StreamErrorCode) func (*Stream).CancelRead(e StreamErrorCode) func (*Stream).CancelWrite(e StreamErrorCode)
Package-Level Functions (only one)
Package-Level Constants (total 2)
WTBufferedStreamRejectedErrorCode is the error code of the WT_BUFFERED_STREAM_REJECTED error.
WTSessionGoneErrorCode is the error code of the WT_SESSION_GONE error.