webtransport

package
v0.5.28 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2024 License: MIT Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	WebtransportConnsAccepted = expvar.NewInt("webtransport_conns_accepted")
	WebtransportConnsOpened   = expvar.NewInt("webtransport_conns_opened")
	WebtransportConnsClosed   = expvar.NewInt("webtransport_conns_closed")
)
View Source
var CancelRead webtransport.StreamErrorCode = 3558
View Source
var CancelWrite webtransport.StreamErrorCode = 3559
View Source
var MaxIncomingStreams int64 = 1 << 60

2^60 == 1152921504606846976

View Source
var QUICConfig = &quic.Config{
	EnableDatagrams:    true,
	MaxIncomingStreams: MaxIncomingStreams,
}

Functions

func DialAddr

func DialAddr(addr string, relayURL *url.URL) (string, error)

func Listen

func Listen(ctx context.Context, addr string) (*common.Listener, error)

Types

type StreamConn

type StreamConn struct {
	webtransport.Stream
	Session *webtransport.Session
}

StreamsConn wraps webtransport.Stream into net.Conn

func (*StreamConn) Close

func (sc *StreamConn) Close() error

Close calls CancelRead to avoid memory leak, see - https://github.com/quic-go/quic-go/issues/3558 - https://pkg.go.dev/github.com/quic-go/webtransport-go#Stream

func (*StreamConn) CloseRead

func (sc *StreamConn) CloseRead() error

func (*StreamConn) CloseWrite

func (sc *StreamConn) CloseWrite() error

func (*StreamConn) LocalAddr

func (sc *StreamConn) LocalAddr() net.Addr

LocalAddr is required to impl net.Conn

func (*StreamConn) RemoteAddr

func (sc *StreamConn) RemoteAddr() net.Addr

RemoteAddr is required to impl net.Conn

type Transport added in v0.5.12

type Transport struct{}

func (*Transport) Dial added in v0.5.12

func (t *Transport) Dial(ctx context.Context, addr string) (tunnel.Session, error)

func (*Transport) Listen added in v0.5.12

func (t *Transport) Listen(ctx context.Context, addr string) (net.Listener, error)

type Upgrader added in v0.5.24

type Upgrader struct {
	HOST string

	*wt.Server
	// contains filtered or unexported fields
}

func (*Upgrader) Root added in v0.5.24

func (s *Upgrader) Root() string

func (*Upgrader) ServeHTTP added in v0.5.24

func (s *Upgrader) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Upgrader) Upgrade added in v0.5.24

func (s *Upgrader) Upgrade() (*edge.Edge, error)

type WebtransportSession

type WebtransportSession struct {
	*webtransport.Session
}

func Dial added in v0.5.13

func Dial(ctx context.Context, addr string, hdr http.Header) (*WebtransportSession, error)

func (*WebtransportSession) Accept added in v0.5.15

func (*WebtransportSession) Close

func (s *WebtransportSession) Close() error

func (*WebtransportSession) Open added in v0.5.15

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL