websocket

package
v4.38.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2021 License: MIT Imports: 25 Imported by: 6

Documentation

Overview

Package websocket implements Websocket transport

Websocket transport implements an HTTP(S) compliable, surveillance proof transport method with plausible deniability.

Index

Constants

This section is empty.

Variables

View Source
var File_transport_internet_websocket_config_proto protoreflect.FileDescriptor

Functions

func Dial

Dial dials a WebSocket connection to the given destination.

func ListenWS

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

Types

type Config

type Config struct {

	// URL path to the WebSocket service. Empty value means root(/).
	Path                 string    `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
	Header               []*Header `protobuf:"bytes,3,rep,name=header,proto3" json:"header,omitempty"`
	AcceptProxyProtocol  bool      `protobuf:"varint,4,opt,name=accept_proxy_protocol,json=acceptProxyProtocol,proto3" json:"accept_proxy_protocol,omitempty"`
	MaxEarlyData         int32     `protobuf:"varint,5,opt,name=max_early_data,json=maxEarlyData,proto3" json:"max_early_data,omitempty"`
	UseBrowserForwarding bool      `protobuf:"varint,6,opt,name=use_browser_forwarding,json=useBrowserForwarding,proto3" json:"use_browser_forwarding,omitempty"`
	// contains filtered or unexported fields
}

func (*Config) Descriptor deprecated

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

Deprecated: Use Config.ProtoReflect.Descriptor instead.

func (*Config) GetAcceptProxyProtocol

func (x *Config) GetAcceptProxyProtocol() bool

func (*Config) GetHeader

func (x *Config) GetHeader() []*Header

func (*Config) GetMaxEarlyData added in v4.37.0

func (x *Config) GetMaxEarlyData() int32

func (*Config) GetNormalizedPath

func (c *Config) GetNormalizedPath() string

func (*Config) GetPath

func (x *Config) GetPath() string

func (*Config) GetRequestHeader

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

func (*Config) GetUseBrowserForwarding added in v4.37.0

func (x *Config) GetUseBrowserForwarding() bool

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

type DelayedDialer added in v4.37.0

type DelayedDialer interface {
	Dial(earlyData []byte) (*websocket.Conn, error)
}

type DelayedDialerForwarded added in v4.37.0

type DelayedDialerForwarded interface {
	Dial(earlyData []byte) (io.ReadWriteCloser, error)
}
type Header struct {
	Key   string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*Header) Descriptor deprecated

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

Deprecated: Use Header.ProtoReflect.Descriptor instead.

func (*Header) GetKey

func (x *Header) GetKey() string

func (*Header) GetValue

func (x *Header) GetValue() string

func (*Header) ProtoMessage

func (*Header) ProtoMessage()

func (*Header) ProtoReflect

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

func (*Header) Reset

func (x *Header) Reset()

func (*Header) String

func (x *Header) String() string

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().

Jump to

Keyboard shortcuts

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