splithttp

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: AGPL-3.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const ChromeH2KeepAlivePeriod = 45 * time.Second

consistent with chrome

View Source
const ConnIdleTimeout = 300 * time.Second
View Source
const QuicgoH3KeepAlivePeriod = 10 * time.Second

consistent with quic-go

Variables

This section is empty.

Functions

func GetNormalizedPath added in v1.1.2

func GetNormalizedPath(c *SplitHttpConfig) string

func GetNormalizedQuery added in v1.1.2

func GetNormalizedQuery(c *SplitHttpConfig) string

func GetNormalizedScMaxBufferedPosts added in v1.1.2

func GetNormalizedScMaxBufferedPosts(c *SplitHttpConfig) int

func GetRequestHeader added in v1.1.2

func GetRequestHeader(c *SplitHttpConfig, rawURL string) (http.Header, error)

func Init added in v1.1.2

func Init(m *XmuxConfig)

func IsValidHTTPHost

func IsValidHTTPHost(request string, config string) bool

func NewUploadQueue

func NewUploadQueue(maxPackets int) *uploadQueue

func Rand added in v1.1.2

func Rand(c RangeConfig) int32

func WriteResponseHeader added in v1.1.2

func WriteResponseHeader(c *SplitHttpConfig, writer http.ResponseWriter)

Types

type DefaultDialerClient

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

implements splithttp.DialerClient in terms of direct network connections

func (*DefaultDialerClient) IsClosed

func (c *DefaultDialerClient) IsClosed() bool

func (*DefaultDialerClient) OpenStream

func (c *DefaultDialerClient) OpenStream(ctx context.Context, url string, body io.Reader, uploadOnly bool) (wrc io.ReadCloser, remoteAddr, localAddr gonet.Addr, err error)

func (*DefaultDialerClient) PostPacket

func (c *DefaultDialerClient) PostPacket(ctx context.Context, url string, body io.Reader, contentLength int64) error

type DialerClient

type DialerClient interface {
	IsClosed() bool

	// ctx, url, body, uploadOnly
	OpenStream(context.Context, string, io.Reader, bool) (io.ReadCloser, net.Addr, net.Addr, error)

	// ctx, url, body, contentLength
	PostPacket(context.Context, string, io.Reader, int64) error
}

interface to abstract between use of browser dialer, vs net/http

type DownConfig

type DownConfig = xhpb.DownConfig

type DownConfig_Reality

type DownConfig_Reality = xhpb.DownConfig_Reality

type DownConfig_Tls

type DownConfig_Tls = xhpb.DownConfig_Tls

type FakePacketConn

type FakePacketConn struct {
	net.Conn
}

func (*FakePacketConn) LocalAddr

func (c *FakePacketConn) LocalAddr() net.Addr

func (*FakePacketConn) ReadFrom

func (c *FakePacketConn) ReadFrom(p []byte) (n int, addr net.Addr, err error)

func (*FakePacketConn) SetReadBuffer

func (c *FakePacketConn) SetReadBuffer(bytes int) error

func (*FakePacketConn) WriteTo

func (c *FakePacketConn) WriteTo(p []byte, _ net.Addr) (n int, err error)

type H1Conn

type H1Conn struct {
	UnreadedResponsesCount int
	RespBufReader          *bufio.Reader
	net.Conn
}

func NewH1Conn

func NewH1Conn(conn net.Conn) *H1Conn

type Listener

type Listener struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func ListenXH

func ListenXH(ctx context.Context, addr net.Destination,
	config *SplitHttpConfig, li i.Listener,
	addConn func(net.Conn)) (*Listener, error)

func (*Listener) Addr

func (ln *Listener) Addr() net.Addr

Addr implements net.Listener.Addr().

func (*Listener) Close

func (ln *Listener) Close() error

Close implements net.Listener.Close().

type Packet

type Packet struct {
	Reader  io.ReadCloser
	Payload []byte
	Seq     uint64
}

type RangeConfig

type RangeConfig = xhpb.RangeConfig

func GetNormalizedCMaxReuseTimes added in v1.1.2

func GetNormalizedCMaxReuseTimes(m *XmuxConfig) RangeConfig

func GetNormalizedHMaxRequestTimes added in v1.1.2

func GetNormalizedHMaxRequestTimes(m *XmuxConfig) RangeConfig

func GetNormalizedHMaxReusableSecs added in v1.1.2

func GetNormalizedHMaxReusableSecs(m *XmuxConfig) RangeConfig

func GetNormalizedMaxConcurrency added in v1.1.2

func GetNormalizedMaxConcurrency(m *XmuxConfig) RangeConfig

func GetNormalizedMaxConnections added in v1.1.2

func GetNormalizedMaxConnections(m *XmuxConfig) RangeConfig

func GetNormalizedScMaxEachPostBytes added in v1.1.2

func GetNormalizedScMaxEachPostBytes(c *SplitHttpConfig) RangeConfig

func GetNormalizedScMinPostsIntervalMs added in v1.1.2

func GetNormalizedScMinPostsIntervalMs(c *SplitHttpConfig) RangeConfig

func GetNormalizedScStreamUpServerSecs added in v1.1.2

func GetNormalizedScStreamUpServerSecs(c *SplitHttpConfig) RangeConfig

func GetNormalizedXPaddingBytes added in v1.1.2

func GetNormalizedXPaddingBytes(c *SplitHttpConfig) RangeConfig

type RangeConfig_builder added in v1.1.2

type RangeConfig_builder = xhpb.RangeConfig_builder

type SplitHttpConfig

type SplitHttpConfig = xhpb.SplitHttpConfig

type SplitHttpConfig_builder added in v1.1.2

type SplitHttpConfig_builder = xhpb.SplitHttpConfig_builder

type WaitReadCloser

type WaitReadCloser struct {
	Wait chan struct{}
	io.ReadCloser
}

func (*WaitReadCloser) Close

func (w *WaitReadCloser) Close() error

func (*WaitReadCloser) Read

func (w *WaitReadCloser) Read(b []byte) (int, error)

func (*WaitReadCloser) Set

func (w *WaitReadCloser) Set(rc io.ReadCloser)

type XhttpDialer

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

func NewXhttpDialer

func NewXhttpDialer(config *SplitHttpConfig, sc security.Engine,
	dialer i.DialerListener, dnsServer i.ECHResolver) (*XhttpDialer, error)

func (*XhttpDialer) Dial

func (x *XhttpDialer) Dial(ctx context.Context, dest net.Destination) (net.Conn, error)

type XmuxClient

type XmuxClient struct {
	XmuxConn  XmuxConn
	OpenUsage atomic.Int32

	LeftRequests atomic.Int32
	UnreusableAt time.Time
	// contains filtered or unexported fields
}

type XmuxConfig

type XmuxConfig = xhpb.XmuxConfig

type XmuxConfig_builder added in v1.1.2

type XmuxConfig_builder = xhpb.XmuxConfig_builder

type XmuxConn

type XmuxConn interface {
	IsClosed() bool
}

type XmuxManager

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

func NewXmuxManager

func NewXmuxManager(xmuxConfig XmuxConfig, newConnFunc func() XmuxConn) *XmuxManager

func (*XmuxManager) GetXmuxClient

func (m *XmuxManager) GetXmuxClient(ctx context.Context) *XmuxClient

Jump to

Keyboard shortcuts

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