server

package
v0.0.0-...-8613b64 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2016 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientConn

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

func NewClientConn

func NewClientConn(conn net.Conn, name string, token string, timeout int) *ClientConn

func (*ClientConn) AddHandler

func (self *ClientConn) AddHandler(handler *ProxyHandler)

func (*ClientConn) GetHandler

func (self *ClientConn) GetHandler(key int) *ProxyHandler

func (*ClientConn) GetLoginTime

func (self *ClientConn) GetLoginTime() string

func (*ClientConn) GetMappingNumber

func (self *ClientConn) GetMappingNumber() int

func (*ClientConn) GetMappings

func (self *ClientConn) GetMappings() (mappings []web.MappingModel)

func (*ClientConn) GetName

func (self *ClientConn) GetName() string

func (*ClientConn) RemoveHandler

func (self *ClientConn) RemoveHandler(key int)

func (*ClientConn) UpdateExpireTime

func (self *ClientConn) UpdateExpireTime()

type ClientReader

type ClientReader struct {
	common.ProtocolReader
}

type ProxyHandler

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

func NewProxyHandler

func NewProxyHandler(mainConn net.Conn, tcpServer network.TCPServer, mapping *common.Mapping) *ProxyHandler

func (*ProxyHandler) Free

func (self *ProxyHandler) Free()

func (*ProxyHandler) GetAddr

func (self *ProxyHandler) GetAddr() string

func (*ProxyHandler) GetRemotePort

func (self *ProxyHandler) GetRemotePort() int

func (*ProxyHandler) Handle

func (self *ProxyHandler) Handle(conn net.Conn)

func (*ProxyHandler) IsOn

func (self *ProxyHandler) IsOn() bool

func (*ProxyHandler) TurnOff

func (self *ProxyHandler) TurnOff() bool

func (*ProxyHandler) TurnOn

func (self *ProxyHandler) TurnOn() bool

type Server

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

func NewServer

func NewServer(config *ServerConfig, name string, isTLS bool) *Server

func (*Server) GetClient

func (self *Server) GetClient(name string) (cli web.ClientModel)

func (*Server) GetClientNumber

func (self *Server) GetClientNumber() int

func (*Server) GetClients

func (self *Server) GetClients() (clis []web.ClientModel)

func (*Server) GetMapping

func (self *Server) GetMapping(port int) web.MappingModel

func (*Server) GetMappingNumber

func (self *Server) GetMappingNumber() int

func (*Server) GetMappings

func (self *Server) GetMappings() (mappings []web.MappingModel)

func (*Server) GetName

func (self *Server) GetName() string

func (*Server) GetStartupTime

func (self *Server) GetStartupTime() string

func (*Server) Handle

func (self *Server) Handle(conn net.Conn)

func (*Server) IsTLS

func (self *Server) IsTLS() bool

func (*Server) Supervise

func (self *Server) Supervise()

func (*Server) TurnMappingOff

func (self *Server) TurnMappingOff(port int) bool

func (*Server) TurnMappingOn

func (self *Server) TurnMappingOn(port int) bool

func (*Server) WebDemon

func (self *Server) WebDemon()

type ServerConfig

type ServerConfig struct {
	Ip       string `json:"ip"`
	Port     int    `json:"port"`
	Username string `json:"username"`
	Password string `json:"password"`
	Timeout  int    `json:"timeout"`
	TLS      struct {
		Enabled bool   `json:"enabled"`
		Port    int    `json:"port"`
		Ca      string `json:"ca"`
		Key     string `json:"key"`
	} `json:"tls"`
	Web web.WebConfig `json:"web"`
}

Jump to

Keyboard shortcuts

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