net

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DialTcpByHttpProxy

func DialTcpByHttpProxy(proxyHost string, dstAddr string, auth *ProxyAuth) (c net.Conn, err error)

func DialTcpByProxy

func DialTcpByProxy(proxyStr string, addr string) (c net.Conn, err error)

func DialTcpBySocks5Proxy

func DialTcpBySocks5Proxy(proxyHost string, dstAddr string, auth *ProxyAuth) (c net.Conn, err error)

Types

type ProxyAuth

type ProxyAuth struct {
	Enable   bool
	Username string
	Passwd   string
}

type SharedConn

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

func NewSharedConn

func NewSharedConn(conn net.Conn) (*SharedConn, io.Reader)

the bytes you read in io.Reader, will be reserved in SharedConn

func NewSharedConnSize

func NewSharedConnSize(conn net.Conn, bufSize int) (*SharedConn, io.Reader)

func (*SharedConn) Read

func (sc *SharedConn) Read(p []byte) (n int, err error)

Not thread safety.

func (*SharedConn) ResetBuf

func (sc *SharedConn) ResetBuf(buffer []byte) (err error)

Jump to

Keyboard shortcuts

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