Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListenAddr ¶
func ListenAddr(options *ListenOptions) (net.Listener, error)
ListenAddr creates an HTTP/3 server listening on a given address. The net.Conn instances returned by the net.Listener may be multiplexed connections.
func NewClient ¶
func NewClient(config *ClientOptions) *client
NewClient returns a client that creates multiplexed WebTransport based sessions
func NewConn ¶
func NewConn(stream webtransport.Stream, session *webtransport.Session, res *http.Response, onClose streamClosedFn) net.Conn
NewConn creates a new net.Conn from a webtransport.Stream, session, and http.Response
Types ¶
type ClientOptions ¶
type DatagramChunker ¶
type DatagramChunker struct {
// contains filtered or unexported fields
}
DatagramChunker handles chunking and reassemly of datagram payloads
func NewDatagramChunker ¶
func NewDatagramChunker() *DatagramChunker
NewDatagramChunker creates a new ChunkedDatagramHandler that handles chunking and reassembly of datagram payloads
func (*DatagramChunker) Chunk ¶
func (dc *DatagramChunker) Chunk(p []byte) [][]byte
Chunk splits a message into datagram chunks to be sent over the wire
func (*DatagramChunker) Close ¶
func (dc *DatagramChunker) Close()
Close disposes of the instance. After calling Close() the instance can not be used anymore
func (*DatagramChunker) Read ¶
func (dc *DatagramChunker) Read() ([]byte, error)
Read returns the complete/assembled message
func (*DatagramChunker) Receive ¶
func (dc *DatagramChunker) Receive(data []byte)
Receive processes a datagram chunk, assembles them, and queues complete messages that will be returned from Read()
type ListenOptions ¶
type ListenOptions struct {
Addr string
Path string
TLSConfig *tls.Config
QUICConfig *quic.Config
Handler *http.ServeMux
// DatagramHandler is an optional datagram handler that will be called when a new WebTransport session is created
// It will be called with a net.PacketConn that wraps the WebTransport session, and with the remote address
DatagramHandler func(pconn net.PacketConn, remoteAddr net.Addr)
}