gun

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLength = errors.New("invalid length")
	ErrSmallBuffer   = errors.New("buffer too small")
)

Functions

func StreamGunWithConn

func StreamGunWithConn(conn net.Conn, tlsConfig *tls.Config, cfg *Config, realityConfig *tlsC.RealityConfig) (net.Conn, error)

func StreamGunWithTransport

func StreamGunWithTransport(transport *TransportWrap, cfg *Config) (net.Conn, error)

func UVarintLen

func UVarintLen(x uint64) int

Types

type Config

type Config struct {
	ServiceName       string
	Host              string
	ClientFingerprint string
}

type Conn

type Conn struct {
	// contains filtered or unexported fields
}

func (*Conn) Close

func (g *Conn) Close() error

func (*Conn) FrontHeadroom

func (g *Conn) FrontHeadroom() int

func (*Conn) LocalAddr

func (g *Conn) LocalAddr() net.Addr

func (*Conn) Read

func (g *Conn) Read(b []byte) (n int, err error)

func (*Conn) RemoteAddr

func (g *Conn) RemoteAddr() net.Addr

func (*Conn) SetDeadline

func (g *Conn) SetDeadline(t time.Time) error

func (*Conn) SetReadDeadline

func (g *Conn) SetReadDeadline(t time.Time) error

func (*Conn) SetWriteDeadline

func (g *Conn) SetWriteDeadline(t time.Time) error

func (*Conn) Write

func (g *Conn) Write(b []byte) (n int, err error)

func (*Conn) WriteBuffer

func (g *Conn) WriteBuffer(buffer *buf.Buffer) error

type DialFn

type DialFn = func(network, addr string) (net.Conn, error)

type TransportWrap

type TransportWrap struct {
	*http2.Transport
	// contains filtered or unexported fields
}

func NewHTTP2Client

func NewHTTP2Client(dialFn DialFn, tlsConfig *tls.Config, Fingerprint string, realityConfig *tlsC.RealityConfig) *TransportWrap

func (*TransportWrap) LocalAddr

func (tw *TransportWrap) LocalAddr() net.Addr

func (*TransportWrap) RemoteAddr

func (tw *TransportWrap) RemoteAddr() net.Addr

Jump to

Keyboard shortcuts

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