quic

package
v0.5.39 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2025 License: MIT Imports: 16 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	QuicGoConnsAccepted = expvar.NewInt("quic_go_conns_accepted")
	QuicGoConnsOpened   = expvar.NewInt("quic_go_conns_opened")
	QuicGoConnsClosed   = expvar.NewInt("quic_go_conns_closed")
)
View Source
var CancelRead quic.StreamErrorCode = 3558
View Source
var CancelWrite quic.StreamErrorCode = 3559
View Source
var MaxIncomingStreams int64 = 1 << 60

2^60 == 1152921504606846976

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

Functions

func Listen

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

Types

type QuicSession

type QuicSession struct {
	Session quic.Connection
}

func Dial

func Dial(ctx context.Context, addr string) (*QuicSession, error)

func (*QuicSession) Accept

func (s *QuicSession) Accept(ctx context.Context) (tunnel.Stream, error)

func (*QuicSession) Close

func (s *QuicSession) Close() error

func (*QuicSession) Open

func (s *QuicSession) Open(ctx context.Context) (tunnel.Stream, error)

type StreamConn

type StreamConn struct {
	quic.Stream
	Session quic.Connection
}

StreamsConn wraps quic.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/quic-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

type Transport struct{}

func (*Transport) Dial

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

func (*Transport) Listen

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

type Upgrader added in v0.5.24

type Upgrader struct {
	*quic.Listener
	common.RootPatterns
}

func (*Upgrader) Upgrade added in v0.5.24

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

Jump to

Keyboard shortcuts

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