Documentation ¶
Index ¶
- Constants
- func IsClosedConnectionError(err error) bool
- func JoinHostPort(host string, port uint16) string
- func NewRequestID() string
- func ProxyTCP(reqID string, downConn, upConn *net.TCPConn)
- func ProxyUDP(reqID string, downConn *net.TCPConn, upConn net.Conn)
- func ReadUDPFromStream(r io.Reader, buf []byte, timeout time.Duration) (n int, err error)
- type AckCode
- type Acknowledgement
- type Addr
- type Header
- type UDPConn
Constants ¶
View Source
const ( AckCodeOK = iota + 1 AckCodeUnknownError AckCodeNoSuchHost AckCodeResolveTimeout AckCodeConnectTimeout AckCodeUnknownProtocol )
View Source
const ( AddrTypeIP byte = iota AddrTypeHost )
View Source
const ( ProtocolTCP byte = iota ProtocolUDP )
Variables ¶
This section is empty.
Functions ¶
func IsClosedConnectionError ¶
func JoinHostPort ¶
func NewRequestID ¶ added in v0.0.6
func NewRequestID() string
func ProxyTCP ¶
ProxyTCP is excerpt from https://stackoverflow.com/a/27445109/4725840
Types ¶
type Acknowledgement ¶ added in v0.0.6
type Acknowledgement struct {
Code AckCode
}
func (*Acknowledgement) FromReader ¶ added in v0.0.6
func (a *Acknowledgement) FromReader(r io.Reader) error
func (*Acknowledgement) Marshal ¶ added in v0.0.6
func (a *Acknowledgement) Marshal() []byte
type Addr ¶
type Addr struct {
// contains filtered or unexported fields
}
func AddrFromBytes ¶
func AddrFromHost ¶
func AddrFromIP ¶
Click to show internal directories.
Click to hide internal directories.