splithttp

package
v1.8.24 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: MPL-2.0 Imports: 37 Imported by: 3

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 added in v1.8.17

type BrowserDialerClient struct{}

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

func (*BrowserDialerClient) OpenDownload added in v1.8.17

func (c *BrowserDialerClient) OpenDownload(ctx context.Context, baseURL string) (io.ReadCloser, gonet.Addr, gonet.Addr, error)

func (*BrowserDialerClient) SendUploadRequest added in v1.8.17

func (c *BrowserDialerClient) SendUploadRequest(ctx context.Context, url string, payload io.ReadWriteCloser, 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"`
	Header               map[string]string `` /* 153-byte string literal not displayed */
	ScMaxConcurrentPosts *RandRangeConfig  `protobuf:"bytes,4,opt,name=scMaxConcurrentPosts,proto3" json:"scMaxConcurrentPosts,omitempty"`
	ScMaxEachPostBytes   *RandRangeConfig  `protobuf:"bytes,5,opt,name=scMaxEachPostBytes,proto3" json:"scMaxEachPostBytes,omitempty"`
	ScMinPostsIntervalMs *RandRangeConfig  `protobuf:"bytes,6,opt,name=scMinPostsIntervalMs,proto3" json:"scMinPostsIntervalMs,omitempty"`
	NoSSEHeader          bool              `protobuf:"varint,7,opt,name=noSSEHeader,proto3" json:"noSSEHeader,omitempty"`
	XPaddingBytes        *RandRangeConfig  `protobuf:"bytes,8,opt,name=xPaddingBytes,proto3" json:"xPaddingBytes,omitempty"`
	// contains filtered or unexported fields
}

func (*Config) Descriptor deprecated

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

Deprecated: Use Config.ProtoReflect.Descriptor instead.

func (*Config) GetHeader

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

func (*Config) GetHost

func (x *Config) GetHost() string

func (*Config) GetNoSSEHeader added in v1.8.22

func (x *Config) GetNoSSEHeader() bool

func (*Config) GetNormalizedPath

func (c *Config) GetNormalizedPath() string

func (*Config) GetNormalizedQuery added in v1.8.24

func (c *Config) GetNormalizedQuery() string

func (*Config) GetNormalizedScMaxConcurrentPosts added in v1.8.23

func (c *Config) GetNormalizedScMaxConcurrentPosts() RandRangeConfig

func (*Config) GetNormalizedScMaxEachPostBytes added in v1.8.23

func (c *Config) GetNormalizedScMaxEachPostBytes() RandRangeConfig

func (*Config) GetNormalizedScMinPostsIntervalMs added in v1.8.23

func (c *Config) GetNormalizedScMinPostsIntervalMs() RandRangeConfig

func (*Config) GetNormalizedXPaddingBytes added in v1.8.24

func (c *Config) GetNormalizedXPaddingBytes() RandRangeConfig

func (*Config) GetPath

func (x *Config) GetPath() string

func (*Config) GetRequestHeader

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

func (*Config) GetScMaxConcurrentPosts added in v1.8.23

func (x *Config) GetScMaxConcurrentPosts() *RandRangeConfig

func (*Config) GetScMaxEachPostBytes added in v1.8.23

func (x *Config) GetScMaxEachPostBytes() *RandRangeConfig

func (*Config) GetScMinPostsIntervalMs added in v1.8.23

func (x *Config) GetScMinPostsIntervalMs() *RandRangeConfig

func (*Config) GetXPaddingBytes added in v1.8.24

func (x *Config) GetXPaddingBytes() *RandRangeConfig

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 added in v1.8.24

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

type DefaultDialerClient added in v1.8.17

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

implements splithttp.DialerClient in terms of direct network connections

func (*DefaultDialerClient) OpenDownload added in v1.8.17

func (c *DefaultDialerClient) OpenDownload(ctx context.Context, baseURL string) (io.ReadCloser, gonet.Addr, gonet.Addr, error)

func (*DefaultDialerClient) SendUploadRequest added in v1.8.17

func (c *DefaultDialerClient) SendUploadRequest(ctx context.Context, url string, payload io.ReadWriteCloser, contentLength int64) error

type DialerClient added in v1.8.17

type DialerClient interface {
	// (ctx, baseURL, payload) -> err
	// baseURL already contains sessionId and seq
	SendUploadRequest(context.Context, string, io.ReadWriteCloser, int64) error

	// (ctx, baseURL) -> (downloadReader, remoteAddr, localAddr)
	// baseURL already contains sessionId
	OpenDownload(context.Context, string) (io.ReadCloser, net.Addr, net.Addr, error)
}

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

type LazyReader added in v1.8.16

type LazyReader struct {
	CreateReader func() (io.Reader, error)
	// contains filtered or unexported fields
}

Close is intentionally not supported by LazyReader because it's not clear how CreateReader should be aborted in case of Close. It's best to wrap LazyReader in another struct that handles Close correctly, or better, stop using LazyReader entirely.

func (*LazyReader) Read added in v1.8.16

func (r *LazyReader) Read(b []byte) (int, error)

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 {
	Payload []byte
	Seq     uint64
}

type RandRangeConfig added in v1.8.22

type RandRangeConfig 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 (*RandRangeConfig) Descriptor deprecated added in v1.8.22

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

Deprecated: Use RandRangeConfig.ProtoReflect.Descriptor instead.

func (*RandRangeConfig) GetFrom added in v1.8.22

func (x *RandRangeConfig) GetFrom() int32

func (*RandRangeConfig) GetTo added in v1.8.22

func (x *RandRangeConfig) GetTo() int32

func (*RandRangeConfig) ProtoMessage added in v1.8.22

func (*RandRangeConfig) ProtoMessage()

func (*RandRangeConfig) ProtoReflect added in v1.8.22

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

func (*RandRangeConfig) Reset added in v1.8.22

func (x *RandRangeConfig) Reset()

func (*RandRangeConfig) String added in v1.8.22

func (x *RandRangeConfig) String() string

Jump to

Keyboard shortcuts

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