Documentation ¶
Index ¶
- Constants
- type ConnectionError
- type Dialer
- type ReceiveStream
- type SendStream
- type Server
- func (s *Server) Close() error
- func (s *Server) ListenAndServe() error
- func (s *Server) ListenAndServeTLS(certFile, keyFile string) error
- func (s *Server) Serve(conn net.PacketConn) error
- func (s *Server) ServeQUICConn(conn quic.Connection) error
- func (s *Server) Upgrade(w http.ResponseWriter, r *http.Request) (*Session, error)
- type Session
- func (s *Session) AcceptStream(ctx context.Context) (Stream, error)
- func (s *Session) AcceptUniStream(ctx context.Context) (ReceiveStream, error)
- func (s *Session) CloseWithError(code SessionErrorCode, msg string) error
- func (c *Session) ConnectionState() quic.ConnectionState
- func (s *Session) Context() context.Context
- func (s *Session) LocalAddr() net.Addr
- func (s *Session) OpenStream() (Stream, error)
- func (s *Session) OpenStreamSync(ctx context.Context) (str Stream, err error)
- func (s *Session) OpenUniStream() (SendStream, error)
- func (s *Session) OpenUniStreamSync(ctx context.Context) (str SendStream, err error)
- func (s *Session) RemoteAddr() net.Addr
- type SessionErrorCode
- type Stream
- type StreamError
- type StreamErrorCode
Constants ¶
View Source
const WebTransportBufferedStreamRejectedErrorCode quic.StreamErrorCode = 0x3994bd84
WebTransportBufferedStreamRejectedErrorCode is the error code of the H3_WEBTRANSPORT_BUFFERED_STREAM_REJECTED error.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectionError ¶
type ConnectionError struct { Remote bool ErrorCode SessionErrorCode Message string }
ConnectionError is a WebTransport connection error.
func (*ConnectionError) Error ¶
func (e *ConnectionError) Error() string
type Dialer ¶
type Dialer struct { // If not set, reasonable defaults will be used. // In order for WebTransport to function, this implementation will: // * overwrite the StreamHijacker and UniStreamHijacker // * enable datagram support // * set the MaxIncomingStreams to 100 on the quic.Config, if unset *http3.RoundTripper // 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. StreamReorderingTimeout time.Duration // contains filtered or unexported fields }
type ReceiveStream ¶
type SendStream ¶
type Server ¶
type Server struct { H3 http3.Server // StreamReorderingTime is the time an incoming WebTransport stream that cannot be associated // with a session is buffered. // 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. StreamReorderingTimeout time.Duration // 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. CheckOrigin func(r *http.Request) bool // contains filtered or unexported fields }
func (*Server) ListenAndServe ¶
func (*Server) ListenAndServeTLS ¶
func (*Server) ServeQUICConn ¶
ServeQUICConn serves a single QUIC connection.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func (*Session) AcceptUniStream ¶
func (s *Session) AcceptUniStream(ctx context.Context) (ReceiveStream, error)
func (*Session) CloseWithError ¶
func (s *Session) CloseWithError(code SessionErrorCode, msg string) error
func (*Session) ConnectionState ¶
func (c *Session) ConnectionState() quic.ConnectionState
func (*Session) OpenStream ¶
func (*Session) OpenStreamSync ¶
func (*Session) OpenUniStream ¶
func (s *Session) OpenUniStream() (SendStream, error)
func (*Session) OpenUniStreamSync ¶
func (s *Session) OpenUniStreamSync(ctx context.Context) (str SendStream, err error)
func (*Session) RemoteAddr ¶
type SessionErrorCode ¶
type SessionErrorCode uint32
SessionErrorCode is an error code for session termination.
type Stream ¶
type Stream interface { SendStream ReceiveStream SetDeadline(time.Time) error }
type StreamError ¶
type StreamError struct {
ErrorCode StreamErrorCode
}
StreamError is the error that is returned from stream operations (Read, Write) when the stream is canceled.
func (*StreamError) Error ¶
func (e *StreamError) Error() string
func (*StreamError) Is ¶
func (e *StreamError) Is(target error) bool
type StreamErrorCode ¶
type StreamErrorCode uint8
StreamErrorCode is an error code used for stream termination.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.