Documentation ¶
Index ¶
- Constants
- Variables
- func Auth(name, host, port, passwd string, callbcak func(sess *ssh.Session))
- func Build(name, host, port, pwd string, config utils.Config)
- func GetStage(src *net.UDPAddr) int
- func GetUDPCon(host string) (con *net.UDPConn, err error)
- func HandleBySrc(src *net.UDPAddr, data []byte) (out []byte, err error)
- func IfProxyStart() bool
- func InitDesktop()
- func KillKcpee()
- func NewCmdRunner(remoteConn net.Conn) error
- func NewForwardingHTTPProxy(logger *log.Logger) *httputil.ReverseProxy
- func ProxySet(localAddr string)
- func Stop(name, host, port, pwd string)
- func UpdateStage(src *net.UDPAddr, stage int)
- type CmdStruct
- type KcpClient
- func (conn *KcpClient) CmdString(cmd string)
- func (conn *KcpClient) Listen(listenAddr string, ifStartUdpListener ...bool) (err error)
- func (kclient *KcpClient) ListenHttpProxy(listenAddr string) (err error)
- func (conn *KcpClient) ListenUDP(listenAddr string) (err error)
- func (kclient *KcpClient) SetMode(mode int)
- func (conn *KcpClient) SetProxyType(tp int)
- type KcpTunnel
- func (tun *KcpTunnel) Connect(listenAddr, host string)
- func (tun *KcpTunnel) ConnectCmd(host string) error
- func (tun *KcpTunnel) ConnectCmdInit(host string) (p1 Stdio, p2 net.Conn, err error)
- func (kcpBase *KcpTunnel) HeartBeatC(stream net.Conn)
- func (tun *KcpTunnel) SetRedirectHost(host string)
- func (tun *KcpTunnel) SetTunMode(mode string)
- func (tun *KcpTunnel) TryPadding(host string)
- func (tun *KcpTunnel) Tunnel(host string)
- func (tun *KcpTunnel) TunnelOne(host string)
- type Proxy
- type Stdio
- func (std *Stdio) Close() error
- func (std *Stdio) LocalAddr() net.Addr
- func (std *Stdio) Read(buf []byte) (n int, err error)
- func (std *Stdio) RemoteAddr() net.Addr
- func (std *Stdio) SetDeadline(t time.Time) error
- func (std *Stdio) SetReadDeadline(t time.Time) error
- func (std *Stdio) SetTimeout(t time.Duration)
- func (std *Stdio) SetWriteDeadline(t time.Time) error
- func (std *Stdio) Write(buf []byte) (n int, err error)
- type UDpSocks5Conn
Constants ¶
View Source
const ( SINGLE_MODE = 0 AUTO_MODE = 1 FLOW_MODE = 20 SOCKS5TYPE = 0 HTTPTYPE = 1 )
View Source
const ( STAGE_INIT = 0 STAGE_CONNECT = 1 STAGE_DONE = 2 STAGE_UNEXISTS = -1 )
View Source
const (
DEFAULT_TIMEOUT = 5 * time.Second
)
Variables ¶
View Source
var ( UDPSTACK = &UDpSocks5Conn{ StackSrc: make(map[string]int), } Locker = sync.RWMutex{} )
View Source
var (
GlobalStatus = false
)
View Source
var (
IsStartHttpProxy = false
)
View Source
var RAW_PROFILE = ""
View Source
var (
TO_STOP = false
)
View Source
var UseGBK = false
View Source
var WaitClose = make(chan int, 5)
Functions ¶
func IfProxyStart ¶
func IfProxyStart() bool
func InitDesktop ¶
func InitDesktop()
func NewCmdRunner ¶
func NewForwardingHTTPProxy ¶
func NewForwardingHTTPProxy(logger *log.Logger) *httputil.ReverseProxy
NewForwardingHTTPProxy retuns a new reverse proxy that takes an incoming request and sends it to another server, proxying the response back to the client.
func UpdateStage ¶
Types ¶
type CmdStruct ¶
type CmdStruct struct { UseGbk bool // contains filtered or unexported fields }
CmdStruct for cmd byte
func NewCmdStruct ¶
NewCmdStruct construct NewCmd with string
type KcpClient ¶
type KcpClient struct { utils.KcpBase RRR uint16 ShowLog int CmdChan chan string // contains filtered or unexported fields }
KcpClient for client and cmd
func NewKcpClient ¶
NewKcpClient init KcpClient
func (*KcpClient) CmdString ¶
CmdString run cmd like redirect://ss://xxxxxxxx | redirect://ls | redirect://stop
func (*KcpClient) ListenHttpProxy ¶
func (*KcpClient) SetProxyType ¶
Set client Proxy type as http/socks5
type KcpTunnel ¶
func NewKcpTunnel ¶
func (*KcpTunnel) ConnectCmd ¶
func (*KcpTunnel) ConnectCmdInit ¶
func (*KcpTunnel) HeartBeatC ¶
func (*KcpTunnel) SetRedirectHost ¶
func (*KcpTunnel) SetTunMode ¶
func (*KcpTunnel) TryPadding ¶
type Proxy ¶
type Proxy struct { Logger *zap.Logger AuthUser string AuthPass string Avoid string HandleBody func(p1 net.Conn, host string, afterConnected func(p1, p2 net.Conn)) ForwardingHTTPProxy *httputil.ReverseProxy DestDialTimeout time.Duration DestReadTimeout time.Duration DestWriteTimeout time.Duration ClientReadTimeout time.Duration ClientWriteTimeout time.Duration // contains filtered or unexported fields }
Proxy is a HTTPS forward proxy.
type Stdio ¶
type Stdio struct { UseGbk bool // contains filtered or unexported fields }
func (*Stdio) RemoteAddr ¶
func (*Stdio) SetTimeout ¶
Click to show internal directories.
Click to hide internal directories.