services

package
v0.0.0-...-56a68cf Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2020 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TYPE_TCP     = "tcp"
	TYPE_UDP     = "udp"
	TYPE_HTTP    = "http"
	TYPE_TLS     = "tls"
	CONN_CONTROL = uint8(1)
	CONN_SERVER  = uint8(2)
	CONN_CLIENT  = uint8(3)
)

Variables

This section is empty.

Functions

func Regist

func Regist(name string, s Service, args interface{})

Types

type Args

type Args struct {
	Local     *string
	Parent    *string
	CertBytes []byte
	KeyBytes  []byte
}

type BridgeItem

type BridgeItem struct {
	ServerChn     chan *net.Conn
	ClientChn     chan *net.Conn
	ClientControl *net.Conn
	Once          *sync.Once
	Key           string
}

type HTTP

type HTTP struct {
	// contains filtered or unexported fields
}

func (*HTTP) Clean

func (s *HTTP) Clean()

func (*HTTP) InitBasicAuth

func (s *HTTP) InitBasicAuth() (err error)

func (*HTTP) InitOutConnPool

func (s *HTTP) InitOutConnPool()

func (*HTTP) InitService

func (s *HTTP) InitService()

func (*HTTP) IsBasicAuth

func (s *HTTP) IsBasicAuth() bool

func (*HTTP) IsDeadLoop

func (s *HTTP) IsDeadLoop(inLocalAddr string, host string) bool

func (*HTTP) OutToTCP

func (s *HTTP) OutToTCP(useProxy bool, address string, inConn *net.Conn, req *utils.HTTPRequest) (err error)

func (*HTTP) OutToUDP

func (s *HTTP) OutToUDP(inConn *net.Conn) (err error)

func (*HTTP) Start

func (s *HTTP) Start(args interface{}) (err error)

func (*HTTP) StopService

func (s *HTTP) StopService()

type HTTPArgs

type HTTPArgs struct {
	Args
	Always              *bool
	HTTPTimeout         *int
	Interval            *int
	Blocked             *string
	Direct              *string
	AuthFile            *string
	Auth                *[]string
	ParentType          *string
	LocalType           *string
	Timeout             *int
	PoolSize            *int
	CheckParentInterval *int
}

type Service

type Service interface {
	Start(args interface{}) (err error)
	Clean()
}

func NewHTTP

func NewHTTP() Service

func NewTCP

func NewTCP() Service

func NewTunnelBridge

func NewTunnelBridge() Service

func NewTunnelClient

func NewTunnelClient() Service

func NewTunnelServer

func NewTunnelServer() Service

func NewUDP

func NewUDP() Service

type ServiceItem

type ServiceItem struct {
	S    Service
	Args interface{}
	Name string
}

func Run

func Run(name string) (service *ServiceItem, err error)

type TCP

type TCP struct {
	// contains filtered or unexported fields
}

func (*TCP) Clean

func (s *TCP) Clean()

func (*TCP) InitOutConnPool

func (s *TCP) InitOutConnPool()

func (*TCP) InitService

func (s *TCP) InitService()

func (*TCP) OutToTCP

func (s *TCP) OutToTCP(inConn *net.Conn) (err error)

func (*TCP) OutToUDP

func (s *TCP) OutToUDP(inConn *net.Conn) (err error)

func (*TCP) Start

func (s *TCP) Start(args interface{}) (err error)

func (*TCP) StopService

func (s *TCP) StopService()

type TCPArgs

type TCPArgs struct {
	Args
	ParentType          *string
	IsTLS               *bool
	Timeout             *int
	PoolSize            *int
	CheckParentInterval *int
}

func (*TCPArgs) Protocol

func (a *TCPArgs) Protocol() string

type TunnelBridge

type TunnelBridge struct {
	// contains filtered or unexported fields
}

func (*TunnelBridge) Check

func (s *TunnelBridge) Check()

func (*TunnelBridge) ChnDeamon

func (s *TunnelBridge) ChnDeamon(item *BridgeItem)

func (*TunnelBridge) Clean

func (s *TunnelBridge) Clean()

func (*TunnelBridge) ClientConn

func (s *TunnelBridge) ClientConn(inConn *net.Conn, key string)

func (*TunnelBridge) ClientControlConn

func (s *TunnelBridge) ClientControlConn(inConn *net.Conn, key string)

func (*TunnelBridge) ConnChn

func (s *TunnelBridge) ConnChn(key string, typ uint8) (chn chan *net.Conn, item *BridgeItem)

func (*TunnelBridge) InitService

func (s *TunnelBridge) InitService()

func (*TunnelBridge) ServerConn

func (s *TunnelBridge) ServerConn(inConn *net.Conn, key string)

func (*TunnelBridge) Start

func (s *TunnelBridge) Start(args interface{}) (err error)

func (*TunnelBridge) StopService

func (s *TunnelBridge) StopService()

type TunnelBridgeArgs

type TunnelBridgeArgs struct {
	Args
	Timeout *int
}

type TunnelClient

type TunnelClient struct {
	// contains filtered or unexported fields
}

func (*TunnelClient) Check

func (s *TunnelClient) Check()

func (*TunnelClient) Clean

func (s *TunnelClient) Clean()

func (*TunnelClient) GetConn

func (s *TunnelClient) GetConn() (conn net.Conn, err error)

func (*TunnelClient) GetInConn

func (s *TunnelClient) GetInConn(typ uint8) (outConn net.Conn, err error)

func (*TunnelClient) InitService

func (s *TunnelClient) InitService()

func (*TunnelClient) ServeConn

func (s *TunnelClient) ServeConn()

func (*TunnelClient) ServeUDP

func (s *TunnelClient) ServeUDP()

func (*TunnelClient) Start

func (s *TunnelClient) Start(args interface{}) (err error)

func (*TunnelClient) StopService

func (s *TunnelClient) StopService()

type TunnelClientArgs

type TunnelClientArgs struct {
	Args
	IsUDP   *bool
	Key     *string
	Timeout *int
}

type TunnelServer

type TunnelServer struct {
	// contains filtered or unexported fields
}

func (*TunnelServer) Check

func (s *TunnelServer) Check()

func (*TunnelServer) Clean

func (s *TunnelServer) Clean()

func (*TunnelServer) GetConn

func (s *TunnelServer) GetConn() (conn net.Conn, err error)

func (*TunnelServer) GetOutConn

func (s *TunnelServer) GetOutConn() (outConn net.Conn, err error)

func (*TunnelServer) InitService

func (s *TunnelServer) InitService()

func (*TunnelServer) Start

func (s *TunnelServer) Start(args interface{}) (err error)

func (*TunnelServer) StopService

func (s *TunnelServer) StopService()

func (*TunnelServer) UDPConnDeamon

func (s *TunnelServer) UDPConnDeamon()

type TunnelServerArgs

type TunnelServerArgs struct {
	Args
	IsUDP   *bool
	Key     *string
	Timeout *int
}

type UDP

type UDP struct {
	// contains filtered or unexported fields
}

func (*UDP) Clean

func (s *UDP) Clean()

func (*UDP) GetConn

func (s *UDP) GetConn(connKey string) (conn net.Conn, isNew bool, err error)

func (*UDP) InitOutConnPool

func (s *UDP) InitOutConnPool()

func (*UDP) InitService

func (s *UDP) InitService()

func (*UDP) OutToTCP

func (s *UDP) OutToTCP(packet []byte, localAddr, srcAddr *net.UDPAddr) (err error)

func (*UDP) OutToUDP

func (s *UDP) OutToUDP(packet []byte, localAddr, srcAddr *net.UDPAddr) (err error)

func (*UDP) Start

func (s *UDP) Start(args interface{}) (err error)

func (*UDP) StopService

func (s *UDP) StopService()

type UDPArgs

type UDPArgs struct {
	Args
	ParentType          *string
	Timeout             *int
	PoolSize            *int
	CheckParentInterval *int
}

type UDPItem

type UDPItem struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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