conn

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2019 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const UDPBufSize = 65536

UDPBufSize is the size of udp buffer.

Variables

This section is empty.

Functions

func OutboundIP

func OutboundIP() string

OutboundIP returns preferred outbound ip of this machine.

func Relay

func Relay(left, right net.Conn) (int64, int64, error)

Relay relays between left and right.

func RelayUDP added in v0.9.3

func RelayUDP(dst net.PacketConn, target net.Addr, src net.PacketConn, timeout time.Duration) error

RelayUDP copys from src to dst at target with read timeout.

Types

type Conn

type Conn struct {
	net.Conn
	// contains filtered or unexported fields
}

Conn is a base conn struct.

func NewConn

func NewConn(c net.Conn) *Conn

NewConn returns a new conn.

func (*Conn) Peek

func (c *Conn) Peek(n int) ([]byte, error)

Peek returns the next n bytes without advancing the reader.

func (*Conn) Read

func (c *Conn) Read(p []byte) (int, error)

func (*Conn) Reader added in v0.6.10

func (c *Conn) Reader() *bufio.Reader

Reader returns the internal bufio.Reader.

Jump to

Keyboard shortcuts

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