network

package
v3.0.0-...-1f68d82 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package network contains all protocols for remote connection used by ZBProxy.

To implement an outbound protocol, one needs to do the following: 1. Implement the interface(s) below.

Index

Constants

This section is empty.

Variables

View Source
var SystemDialer = &systemOutbound{}

Functions

func SetDialerMultiPathTCP

func SetDialerMultiPathTCP(dialer *net.Dialer, use bool)

func SetDialerTCPKeepAlive

func SetDialerTCPKeepAlive(dialer *net.Dialer, config KeepAliveConfig)

func SetListenerMultiPathTCP

func SetListenerMultiPathTCP(listenConfig *net.ListenConfig, use bool)

func SetListenerTCPKeepAlive

func SetListenerTCPKeepAlive(listenConfig *net.ListenConfig, config KeepAliveConfig)

Types

type ControlFunc

type ControlFunc = func(network string, address string, c syscall.RawConn) error

func NewDialerControlFromOptions

func NewDialerControlFromOptions(option *OutboundSocketOptions) ControlFunc

func NewListenerControlFromOptions

func NewListenerControlFromOptions(option *InboundSocketOptions) ControlFunc

type Dialer

type Dialer interface {
	DialContext(ctx context.Context, network, address string) (net.Conn, error)
}

func NewSystemDialer

func NewSystemDialer(options *OutboundSocketOptions) Dialer

type Handshake

type Handshake interface {
	Handshake(r io.Reader, w io.Writer, network, address string) error
}

type InboundSocketOptions

type InboundSocketOptions struct {
	Mark          int    `json:",omitempty"`
	SendThrough   string `json:",omitempty"`
	TCPCongestion string `json:",omitempty"`
	TCPFastOpen   bool   `json:",omitempty"`
	MultiPathTCP  bool   `json:",omitempty"`
	// contains filtered or unexported fields
}

func (*InboundSocketOptions) KeepAliveConfig

func (o *InboundSocketOptions) KeepAliveConfig() (c KeepAliveConfig)

type KeepAliveConfig

type KeepAliveConfig = net.KeepAliveConfig

type OutboundSocketOptions

type OutboundSocketOptions struct {
	Mark          int    `json:",omitempty"`
	Interface     string `json:",omitempty"`
	SendThrough   string `json:",omitempty"`
	TCPCongestion string `json:",omitempty"`
	TCPFastOpen   bool   `json:",omitempty"`
	MultiPathTCP  bool   `json:",omitempty"`
	// contains filtered or unexported fields
}

func ConvertLegacyOutboundOptions

func ConvertLegacyOutboundOptions(inbound *InboundSocketOptions) *OutboundSocketOptions

func (*OutboundSocketOptions) KeepAliveConfig

func (o *OutboundSocketOptions) KeepAliveConfig() (c KeepAliveConfig)

Directories

Path Synopsis
Package socks implemented SOCKS protocol version 4, 4a and 5 (RFC1928).
Package socks implemented SOCKS protocol version 4, 4a and 5 (RFC1928).

Jump to

Keyboard shortcuts

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