Documentation ¶
Index ¶
- Constants
- Variables
- func GetEnv(name, def string) string
- func SecFromEnv(name string, defVal uint64) time.Duration
- type Backend
- type BackendCheckConfig
- type Configure
- type Pool
- type Server
- func (s *Server) AddBackend() error
- func (s *Server) Engine() *gin.Engine
- func (s *Server) ListenHTTPAdmin(addr string) (err error)
- func (s *Server) ListenSocks5(addr string) (err error)
- func (s *Server) ListenTProxy(addr string) (err error)
- func (s *Server) Start() (err error)
- func (s *Server) Stop() (e error)
- func (s *Server) Transport(dst, src io.ReadWriter) (err error)
- type ServerConfig
- type Status
Constants ¶
View Source
const AppName = "socks5lb"
Variables ¶
View Source
var ( Version = "n/a" BuildCommit = "n/a" BuildDate = "n/a" DebugMode = false StartTime time.Time )
Functions ¶
Types ¶
type Backend ¶
type Backend struct { Addr string `yaml:"addr" json:"addr" binding:"required"` UserName string `yaml:"username" json:"username"` Password string `yaml:"password" json:"password"` CheckConfig BackendCheckConfig `yaml:"check_config" json:"check_config"` // contains filtered or unexported fields }
func NewBackend ¶
func NewBackend(addr string, config BackendCheckConfig) (backend *Backend)
NewBackend creates a new Backend instance
type BackendCheckConfig ¶
type Configure ¶
type Configure struct { ServerConfig ServerConfig `yaml:"server"` Backends []Backend `yaml:"backends"` }
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
func (*Pool) AllHealthy ¶
AllHealthy returns all healthy backends
func (*Pool) Next ¶
Next returns the next index in the pool if there is one available Only supports round-robin operations by default
type Server ¶
type Server struct { Pool *Pool Config *ServerConfig // contains filtered or unexported fields }
func (*Server) AddBackend ¶
func (*Server) ListenHTTPAdmin ¶
ListenHTTPAdmin is not implemented by default
func (*Server) ListenSocks5 ¶
ListenSocks5 to listen on a specific address
func (*Server) ListenTProxy ¶
ListenTProxy is listening the local tcp port on the given address Deprecated: this feature will be disabled in the future
type ServerConfig ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.