Documentation
¶
Overview ¶
客户端本地代理处理逻辑
Index ¶
- Constants
- func CloseHttpProxy()
- func CreateNtcpTcp(dstAddr string, area uint8) (net.Conn, error)
- func CreateNtcpTdpBind(area uint8) (ntcp.BindConn, error)
- func CreateNtcpUdp(dstAddr string, area uint8) (net.Conn, error)
- func CreateNtcpUdpBind(area uint8) (ntcp.BindConn, error)
- func CreateNtcpUdpOverTdp(dstAddr string, area uint8) (net.Conn, error)
- func ListenHttpProxy(addr string) error
- func NtcpAutoReconnecCallBack(session *ntcp.NtcpSession)
- func RunNtcpServer() error
- func RunNtcpSession(servAddr, user, password string, cryptoMethod crypto.CryptoType, ...) error
- type BindConn
- type DriverProxyHeader
- type NtcpMemer
- type NtcpMempool
- type ProxyLocal
- func (pl *ProxyLocal) AcceptIcmp(src net.Conn, from net.Addr, to net.Addr) bool
- func (pl *ProxyLocal) AcceptIp(src net.Conn, from net.Addr, to net.Addr) bool
- func (pl *ProxyLocal) AcceptTcp(src net.Conn, from net.Addr, to net.Addr) bool
- func (pl *ProxyLocal) AcceptUdp(src net.Conn, from net.Addr, to net.Addr) bool
- func (pl *ProxyLocal) DnsPair(domain, ip string)
- func (pl *ProxyLocal) IsStunIp(ip string) bool
- func (pl *ProxyLocal) ParseStunHost()
- func (pl *ProxyLocal) SetStunHost(host string)
- func (pl *ProxyLocal) SetUdpOverTcp(value bool)
Constants ¶
View Source
const ( UdpReadBufferSize = 32 * 1024 UdpWriteBufferSize = 32 * 1024 TcpReadBufferSize = 32 * 1024 TcpWriteBufferSize = 32 * 1024 PacketBufSize = 1024 * 16 MemPoolNodeSize = 1600 )
View Source
const (
ProxyHttpName = "surpass"
)
Variables ¶
This section is empty.
Functions ¶
func CloseHttpProxy ¶
func CloseHttpProxy()
func CreateNtcpTcp ¶
创建ntcp tcp代理客户端
func CreateNtcpTdpBind ¶
创建ntcp udp bind模式代理客户端 在tcp基础上代理数据
func CreateNtcpUdp ¶
创建ntcp udp代理客户端
func CreateNtcpUdpBind ¶
创建ntcp udp bind模式代理客户端
func CreateNtcpUdpOverTdp ¶
创建ntcp udp代理客户端
func ListenHttpProxy ¶
func NtcpAutoReconnecCallBack ¶
func NtcpAutoReconnecCallBack(session *ntcp.NtcpSession)
ntcp session 异常中断回调
func RunNtcpSession ¶
func RunNtcpSession(servAddr, user, password string, cryptoMethod crypto.CryptoType, sessionDeadCB ntcp.NtcpSessionDead) error
创建ntcp session,客户端或者ntcp中间代理服务需要使用
Types ¶
type BindConn ¶
type BindConn interface { Read(b []byte) (n int, err error) ReadFromBind(b []byte) (n int, addr net.Addr, err error) WriteToFromBind(b []byte, from net.Addr) (n int, err error) Close() error LocalAddr() net.Addr RemoteAddr() net.Addr SetDeadline(t time.Time) error SetReadDeadline(t time.Time) error SetWriteDeadline(t time.Time) error }
type DriverProxyHeader ¶
type DriverProxyHeader struct {
// contains filtered or unexported fields
}
type NtcpMempool ¶
type NtcpMempool struct {
// contains filtered or unexported fields
}
func NewMemer ¶
func NewMemer() *NtcpMempool
type ProxyLocal ¶
type ProxyLocal struct {
// contains filtered or unexported fields
}
func ProxyLocalInstance ¶
func ProxyLocalInstance() *ProxyLocal
func (*ProxyLocal) AcceptIcmp ¶
func (*ProxyLocal) DnsPair ¶
func (pl *ProxyLocal) DnsPair(domain, ip string)
func (*ProxyLocal) IsStunIp ¶
func (pl *ProxyLocal) IsStunIp(ip string) bool
func (*ProxyLocal) ParseStunHost ¶
func (pl *ProxyLocal) ParseStunHost()
func (*ProxyLocal) SetStunHost ¶
func (pl *ProxyLocal) SetStunHost(host string)
func (*ProxyLocal) SetUdpOverTcp ¶
func (pl *ProxyLocal) SetUdpOverTcp(value bool)
Click to show internal directories.
Click to hide internal directories.