Documentation ¶
Index ¶
- Constants
- Variables
- func PickAddr(addresses string) (addr string, err error)
- type Client
- type LoginRequest
- type Pool
- func (pool *Pool) Add(tun tunnel.Tunnel)
- func (pool *Pool) CutAll()
- func (pool *Pool) GetSize() int
- func (pool *Pool) GetTun(s string) (tun tunnel.Tunnel)
- func (pool *Pool) GetTunnels() (tuns TunSlice)
- func (pool *Pool) HandlerCloseConn(w http.ResponseWriter, req *http.Request)
- func (pool *Pool) HandlerCloseTun(w http.ResponseWriter, req *http.Request)
- func (pool *Pool) HandlerCutoff(w http.ResponseWriter, req *http.Request)
- func (pool *Pool) HandlerLookup(w http.ResponseWriter, req *http.Request)
- func (pool *Pool) HandlerMain(w http.ResponseWriter, req *http.Request)
- func (pool *Pool) Register(mux *http.ServeMux)
- func (pool *Pool) Remove(tun tunnel.Tunnel) (err error)
- func (pool *Pool) ServeConn(conn net.Conn) (err error)
- type ServerDefine
- type TimeSignClient
- type TimeSignServer
- type TunSlice
Constants ¶
View Source
const ( TMPLSESS = `` /* 2445-byte string literal not displayed */ TMPLADDR = `` /* 760-byte string literal not displayed */ )
Variables ¶
View Source
var ( ErrSessionNotFound = errors.New("session not found.") ErrNoSession = errors.New("session in pool but can't pick one.") ErrAuthFailed = errors.New("auth failed") )
View Source
var (
MSG_OK = []byte{0x00}
)
Functions ¶
Types ¶
type Client ¶
type Client struct { *Pool Servers []*ServerDefine MinSess int MaxConn int // contains filtered or unexported fields }
func NewClient ¶
func NewClient(Servers []*ServerDefine, MinSess, MaxConn int) (cli *Client)
func (*Client) DialTimeout ¶
type LoginRequest ¶
func GenLoginRequest ¶
func GenLoginRequest(username, password string) (lreq *LoginRequest)
func (*LoginRequest) GenSignature ¶
func (lreq *LoginRequest) GenSignature(password string) (sig []byte)
func (*LoginRequest) Verify ¶
func (lreq *LoginRequest) Verify(password string) (ok bool)
type Pool ¶
func (*Pool) GetTunnels ¶
func (*Pool) HandlerCloseConn ¶
func (pool *Pool) HandlerCloseConn(w http.ResponseWriter, req *http.Request)
func (*Pool) HandlerCloseTun ¶
func (pool *Pool) HandlerCloseTun(w http.ResponseWriter, req *http.Request)
func (*Pool) HandlerCutoff ¶
func (pool *Pool) HandlerCutoff(w http.ResponseWriter, req *http.Request)
func (*Pool) HandlerLookup ¶
func (pool *Pool) HandlerLookup(w http.ResponseWriter, req *http.Request)
func (*Pool) HandlerMain ¶
func (pool *Pool) HandlerMain(w http.ResponseWriter, req *http.Request)
type ServerDefine ¶
type ServerDefine struct { Server string ServerName string CryptMode string RootCAs string CertFile string CertKeyFile string Cipher string Key string Username string Password string // contains filtered or unexported fields }
func (*ServerDefine) CreateConn ¶
func (sd *ServerDefine) CreateConn() (conn net.Conn, err error)
type TimeSignClient ¶
func NewTimeSignClient ¶
func NewTimeSignClient(dialer common.Dialer, username, password string) (tscli *TimeSignClient)
func (*TimeSignClient) Dial ¶
func (tscli *TimeSignClient) Dial(network, address string) (conn net.Conn, err error)
func (*TimeSignClient) DialTimeout ¶
type TimeSignServer ¶
func NewTimeSignServer ¶
func NewTimeSignServer(handler common.Handler, auth *map[string]string) (tssrv *TimeSignServer)
Click to show internal directories.
Click to hide internal directories.