Documentation
¶
Overview ¶
Package netx provides high-performance networking primitives.
Index ¶
Constants ¶
View Source
const ( // TCPBufferSize is the socket buffer size for high throughput (512KB). TCPBufferSize = 512 * 1024 // KeepAliveInterval for TCP keepalive probes. KeepAliveInterval = 30 * time.Second // LingerTimeout for graceful close. LingerTimeout = 3 )
View Source
const DialTimeout = 10 * time.Second
DialTimeout is the default timeout for establishing connections.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Conn ¶
type Conn interface {
net.Conn
CloseRead() error
CloseWrite() error
SyscallConn() (syscall.RawConn, error)
}
Conn wraps net.TCPConn with half-close support.
type Dialer ¶
Dialer provides high-performance TCP dialing with proper socket tuning.
type Socks5Dialer ¶ added in v0.1.3
type Socks5Dialer struct {
ProxyAddr string
// contains filtered or unexported fields
}
Socks5Dialer wraps a SOCKS5 proxy dialer with socket tuning.
func NewSocks5Dialer ¶ added in v0.1.3
func NewSocks5Dialer(proxyAddr string) (*Socks5Dialer, error)
NewSocks5Dialer creates a new SOCKS5 dialer.
func (*Socks5Dialer) Dial ¶ added in v0.1.3
func (d *Socks5Dialer) Dial(network, address string) (Conn, error)
Dial connects to the address via SOCKS5 proxy.
func (*Socks5Dialer) DialContext ¶ added in v0.1.3
DialContext connects to the address via SOCKS5 proxy with context support.
Click to show internal directories.
Click to hide internal directories.