Documentation ¶
Index ¶
- Constants
- func Copy(dst io.Writer, src io.Reader) (written int64, err error)
- func CopyBuffer(dst io.Writer, src io.Reader) (written int64, err error)
- func OutboundIP() string
- func Relay(left, right net.Conn) error
- func RelayUDP(dst net.PacketConn, target net.Addr, src net.PacketConn, timeout time.Duration) error
- type Conn
Constants ¶
View Source
const ( // TCPBufSize is the size of tcp buffer. TCPBufSize = 16 << 10 // UDPBufSize is the size of udp buffer. UDPBufSize = 64 << 10 )
Variables ¶
This section is empty.
Functions ¶
func Copy ¶ added in v0.10.3
Copy copies from src to dst. it will try to avoid memory allocating by using WriteTo or ReadFrom method, if both failed, then it'll fallback to call CopyBuffer method.
func CopyBuffer ¶ added in v0.10.3
CopyBuffer copies from src to dst with a userspace buffer.
func OutboundIP ¶
func OutboundIP() string
OutboundIP returns preferred outbound ip of this machine.
Types ¶
Click to show internal directories.
Click to hide internal directories.