splithttp

package
v1.0.1-0...-9165f85 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: MPL-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_transport_internet_splithttp_config_proto protoreflect.FileDescriptor

Functions

func Dial

func Dial(ctx context.Context, dest net.Destination, streamSettings *internet.MemoryStreamConfig) (stat.Connection, error)

func ListenSH

func ListenSH(ctx context.Context, address net.Address, port net.Port, streamSettings *internet.MemoryStreamConfig, addConn internet.ConnHandler) (internet.Listener, error)

func NewUploadQueue

func NewUploadQueue(maxPackets int) *uploadQueue

Types

type BrowserDialerClient

type BrowserDialerClient struct{}

implements splithttp.DialerClient in terms of browser dialer has no fields because everything is global state :O)

func (*BrowserDialerClient) IsClosed

func (c *BrowserDialerClient) IsClosed() bool

func (*BrowserDialerClient) OpenStream

func (c *BrowserDialerClient) OpenStream(ctx context.Context, url string, body io.Reader, uploadOnly bool) (io.ReadCloser, gonet.Addr, gonet.Addr, error)

func (*BrowserDialerClient) PostPacket

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

type Config

type Config struct {
	Host                 string                 `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"`
	Path                 string                 `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
	Mode                 string                 `protobuf:"bytes,3,opt,name=mode,proto3" json:"mode,omitempty"`
	Headers              map[string]string      `` /* 155-byte string literal not displayed */
	XPaddingBytes        *RangeConfig           `protobuf:"bytes,5,opt,name=xPaddingBytes,proto3" json:"xPaddingBytes,omitempty"`
	NoGRPCHeader         bool                   `protobuf:"varint,6,opt,name=noGRPCHeader,proto3" json:"noGRPCHeader,omitempty"`
	NoSSEHeader          bool                   `protobuf:"varint,7,opt,name=noSSEHeader,proto3" json:"noSSEHeader,omitempty"`
	ScMaxEachPostBytes   *RangeConfig           `protobuf:"bytes,8,opt,name=scMaxEachPostBytes,proto3" json:"scMaxEachPostBytes,omitempty"`
	ScMinPostsIntervalMs *RangeConfig           `protobuf:"bytes,9,opt,name=scMinPostsIntervalMs,proto3" json:"scMinPostsIntervalMs,omitempty"`
	ScMaxBufferedPosts   int64                  `protobuf:"varint,10,opt,name=scMaxBufferedPosts,proto3" json:"scMaxBufferedPosts,omitempty"`
	Xmux                 *XmuxConfig            `protobuf:"bytes,11,opt,name=xmux,proto3" json:"xmux,omitempty"`
	DownloadSettings     *internet.StreamConfig `protobuf:"bytes,12,opt,name=downloadSettings,proto3" json:"downloadSettings,omitempty"`
	// contains filtered or unexported fields
}

func (*Config) Descriptor deprecated

func (*Config) Descriptor() ([]byte, []int)

Deprecated: Use Config.ProtoReflect.Descriptor instead.

func (*Config) GetDownloadSettings

func (x *Config) GetDownloadSettings() *internet.StreamConfig

func (*Config) GetHeaders

func (x *Config) GetHeaders() map[string]string

func (*Config) GetHost

func (x *Config) GetHost() string

func (*Config) GetMode

func (x *Config) GetMode() string

func (*Config) GetNoGRPCHeader

func (x *Config) GetNoGRPCHeader() bool

func (*Config) GetNoSSEHeader

func (x *Config) GetNoSSEHeader() bool

func (*Config) GetNormalizedPath

func (c *Config) GetNormalizedPath() string

func (*Config) GetNormalizedQuery

func (c *Config) GetNormalizedQuery() string

func (*Config) GetNormalizedScMaxBufferedPosts

func (c *Config) GetNormalizedScMaxBufferedPosts() int

func (*Config) GetNormalizedScMaxEachPostBytes

func (c *Config) GetNormalizedScMaxEachPostBytes() RangeConfig

func (*Config) GetNormalizedScMinPostsIntervalMs

func (c *Config) GetNormalizedScMinPostsIntervalMs() RangeConfig

func (*Config) GetNormalizedXPaddingBytes

func (c *Config) GetNormalizedXPaddingBytes() RangeConfig

func (*Config) GetPath

func (x *Config) GetPath() string

func (*Config) GetRequestHeader

func (c *Config) GetRequestHeader() http.Header

func (*Config) GetScMaxBufferedPosts

func (x *Config) GetScMaxBufferedPosts() int64

func (*Config) GetScMaxEachPostBytes

func (x *Config) GetScMaxEachPostBytes() *RangeConfig

func (*Config) GetScMinPostsIntervalMs

func (x *Config) GetScMinPostsIntervalMs() *RangeConfig

func (*Config) GetXPaddingBytes

func (x *Config) GetXPaddingBytes() *RangeConfig

func (*Config) GetXmux

func (x *Config) GetXmux() *XmuxConfig

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) ProtoReflect

func (x *Config) ProtoReflect() protoreflect.Message

func (*Config) Reset

func (x *Config) Reset()

func (*Config) String

func (x *Config) String() string

func (*Config) WriteResponseHeader

func (c *Config) WriteResponseHeader(writer http.ResponseWriter)

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 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 (*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 struct {
	From int32 `protobuf:"varint,1,opt,name=from,proto3" json:"from,omitempty"`
	To   int32 `protobuf:"varint,2,opt,name=to,proto3" json:"to,omitempty"`
	// contains filtered or unexported fields
}

func (*RangeConfig) Descriptor deprecated

func (*RangeConfig) Descriptor() ([]byte, []int)

Deprecated: Use RangeConfig.ProtoReflect.Descriptor instead.

func (*RangeConfig) GetFrom

func (x *RangeConfig) GetFrom() int32

func (*RangeConfig) GetTo

func (x *RangeConfig) GetTo() int32

func (*RangeConfig) ProtoMessage

func (*RangeConfig) ProtoMessage()

func (*RangeConfig) ProtoReflect

func (x *RangeConfig) ProtoReflect() protoreflect.Message

func (*RangeConfig) Reset

func (x *RangeConfig) Reset()

func (*RangeConfig) String

func (x *RangeConfig) String() string

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 XmuxClient

type XmuxClient struct {
	XmuxConn  XmuxConn
	OpenUsage atomic.Int32

	LeftRequests atomic.Int32
	// contains filtered or unexported fields
}

type XmuxConfig

type XmuxConfig struct {
	MaxConcurrency   *RangeConfig `protobuf:"bytes,1,opt,name=maxConcurrency,proto3" json:"maxConcurrency,omitempty"`
	MaxConnections   *RangeConfig `protobuf:"bytes,2,opt,name=maxConnections,proto3" json:"maxConnections,omitempty"`
	CMaxReuseTimes   *RangeConfig `protobuf:"bytes,3,opt,name=cMaxReuseTimes,proto3" json:"cMaxReuseTimes,omitempty"`
	CMaxLifetimeMs   *RangeConfig `protobuf:"bytes,4,opt,name=cMaxLifetimeMs,proto3" json:"cMaxLifetimeMs,omitempty"`
	HMaxRequestTimes *RangeConfig `protobuf:"bytes,5,opt,name=hMaxRequestTimes,proto3" json:"hMaxRequestTimes,omitempty"`
	HKeepAlivePeriod int64        `protobuf:"varint,6,opt,name=hKeepAlivePeriod,proto3" json:"hKeepAlivePeriod,omitempty"`
	// contains filtered or unexported fields
}

func (*XmuxConfig) Descriptor deprecated

func (*XmuxConfig) Descriptor() ([]byte, []int)

Deprecated: Use XmuxConfig.ProtoReflect.Descriptor instead.

func (*XmuxConfig) GetCMaxLifetimeMs

func (x *XmuxConfig) GetCMaxLifetimeMs() *RangeConfig

func (*XmuxConfig) GetCMaxReuseTimes

func (x *XmuxConfig) GetCMaxReuseTimes() *RangeConfig

func (*XmuxConfig) GetHKeepAlivePeriod

func (x *XmuxConfig) GetHKeepAlivePeriod() int64

func (*XmuxConfig) GetHMaxRequestTimes

func (x *XmuxConfig) GetHMaxRequestTimes() *RangeConfig

func (*XmuxConfig) GetMaxConcurrency

func (x *XmuxConfig) GetMaxConcurrency() *RangeConfig

func (*XmuxConfig) GetMaxConnections

func (x *XmuxConfig) GetMaxConnections() *RangeConfig

func (*XmuxConfig) GetNormalizedCMaxLifetimeMs

func (m *XmuxConfig) GetNormalizedCMaxLifetimeMs() RangeConfig

func (*XmuxConfig) GetNormalizedCMaxRequestTimes

func (m *XmuxConfig) GetNormalizedCMaxRequestTimes() RangeConfig

func (*XmuxConfig) GetNormalizedCMaxReuseTimes

func (m *XmuxConfig) GetNormalizedCMaxReuseTimes() RangeConfig

func (*XmuxConfig) GetNormalizedMaxConcurrency

func (m *XmuxConfig) GetNormalizedMaxConcurrency() RangeConfig

func (*XmuxConfig) GetNormalizedMaxConnections

func (m *XmuxConfig) GetNormalizedMaxConnections() RangeConfig

func (*XmuxConfig) ProtoMessage

func (*XmuxConfig) ProtoMessage()

func (*XmuxConfig) ProtoReflect

func (x *XmuxConfig) ProtoReflect() protoreflect.Message

func (*XmuxConfig) Reset

func (x *XmuxConfig) Reset()

func (*XmuxConfig) String

func (x *XmuxConfig) String() string

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