tcp

package
v1.8.12 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: MPL-2.0 Imports: 20 Imported by: 56

Documentation

Index

Constants

View Source
const SO_ORIGINAL_DST = 80

Variables

View Source
var File_transport_internet_tcp_config_proto protoreflect.FileDescriptor

Functions

func Dial

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

Dial dials a new TCP connection to the given destination.

func GetOriginalDestination

func GetOriginalDestination(conn stat.Connection) (net.Destination, error)

func ListenTCP

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

ListenTCP creates a new Listener based on configurations.

Types

type Config

type Config struct {
	HeaderSettings      *serial.TypedMessage `protobuf:"bytes,2,opt,name=header_settings,json=headerSettings,proto3" json:"header_settings,omitempty"`
	AcceptProxyProtocol bool                 `protobuf:"varint,3,opt,name=accept_proxy_protocol,json=acceptProxyProtocol,proto3" json:"accept_proxy_protocol,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) GetHeaderSettings

func (x *Config) GetHeaderSettings() *serial.TypedMessage

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 Listener

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

Listener is an internet.Listener that listens for TCP connections.

func (*Listener) Addr

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

Addr implements internet.Listener.Addr.

func (*Listener) Close

func (v *Listener) Close() error

Close implements internet.Listener.Close.

Jump to

Keyboard shortcuts

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