Documentation ¶
Index ¶
- Variables
- func LoadConf(confFile string) (err error)
- type ProxyClient
- func (pc *ProxyClient) GetLocalConn() (c *conn.Conn, err error)
- func (pc *ProxyClient) GetRemoteConn(addr string, port int64) (c *conn.Conn, err error)
- func (pc *ProxyClient) StartTunnel(serverAddr string, serverPort int64) (err error)
- func (pc *ProxyClient) StartUdpTunnelOnce(addr string, port int64)
- type UdpProcesser
- func (up *UdpProcesser) Forward(udpPacket *msg.UdpPacket, singleConn *net.UDPConn)
- func (up *UdpProcesser) GetUdpConn(addr string) (singleConn *net.UDPConn, ok bool)
- func (up *UdpProcesser) ReadLoop()
- func (up *UdpProcesser) RemoveUdpConn(addr string)
- func (up *UdpProcesser) Run()
- func (up *UdpProcesser) SetUdpConn(addr string, conn *net.UDPConn)
- func (up *UdpProcesser) UpdateTcpConn(c *conn.Conn)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ServerAddr string = "0.0.0.0" ServerPort int64 = 7000 HttpProxy string = "" LogFile string = "console" LogWay string = "console" LogLevel string = "info" LogMaxDays int64 = 3 PrivilegeToken string = "" HeartBeatInterval int64 = 20 HeartBeatTimeout int64 = 90 )
common config
View Source
var ProxyClients map[string]*ProxyClient = make(map[string]*ProxyClient)
Functions ¶
Types ¶
type ProxyClient ¶
type ProxyClient struct { config.BaseConf LocalIp string LocalPort int64 RemotePort int64 CustomDomains []string Locations []string // contains filtered or unexported fields }
func (*ProxyClient) GetLocalConn ¶
func (pc *ProxyClient) GetLocalConn() (c *conn.Conn, err error)
func (*ProxyClient) GetRemoteConn ¶
func (*ProxyClient) StartTunnel ¶
func (pc *ProxyClient) StartTunnel(serverAddr string, serverPort int64) (err error)
func (*ProxyClient) StartUdpTunnelOnce ¶ added in v0.9.0
func (pc *ProxyClient) StartUdpTunnelOnce(addr string, port int64)
if proxy type is udp, keep a tcp connection for transferring udp packages
type UdpProcesser ¶ added in v0.9.0
type UdpProcesser struct {
// contains filtered or unexported fields
}
func NewUdpProcesser ¶ added in v0.9.0
func NewUdpProcesser(c *conn.Conn, localIp string, localPort int64) *UdpProcesser
func (*UdpProcesser) Forward ¶ added in v0.9.0
func (up *UdpProcesser) Forward(udpPacket *msg.UdpPacket, singleConn *net.UDPConn)
func (*UdpProcesser) GetUdpConn ¶ added in v0.9.0
func (up *UdpProcesser) GetUdpConn(addr string) (singleConn *net.UDPConn, ok bool)
func (*UdpProcesser) ReadLoop ¶ added in v0.9.0
func (up *UdpProcesser) ReadLoop()
func (*UdpProcesser) RemoveUdpConn ¶ added in v0.9.0
func (up *UdpProcesser) RemoveUdpConn(addr string)
func (*UdpProcesser) Run ¶ added in v0.9.0
func (up *UdpProcesser) Run()
func (*UdpProcesser) SetUdpConn ¶ added in v0.9.0
func (up *UdpProcesser) SetUdpConn(addr string, conn *net.UDPConn)
func (*UdpProcesser) UpdateTcpConn ¶ added in v0.9.0
func (up *UdpProcesser) UpdateTcpConn(c *conn.Conn)
Click to show internal directories.
Click to hide internal directories.