Documentation ¶
Index ¶
- Constants
- func LocalizePassages(passages []server.Passage) (psgs []Passage, manager *Passage)
- func New(valueCtx context.Context, dialer proxy.Dialer) (server.Server, error)
- func NewJohn(valueCtx context.Context, dialer proxy.Dialer, sweetLisa config.Lisa, ...) (server.Server, error)
- type Passage
- type Server
- func (s *Server) AddPassages(passages []server.Passage) (err error)
- func (s *Server) Close() error
- func (s *Server) ContentionCheck(thisIP net.IP, passage *Passage) (err error)
- func (s *Server) GetOrBuildUDPConn(lAddr net.Addr, data []byte) (rc net.PacketConn, passage *Passage, plainText []byte, target string, ...)
- func (s *Server) GetUserContextOrInsert(userIP string) *UserContext
- func (s *Server) Listen(addr string) (err error)
- func (s *Server) ListenTCP(addr string) (err error)
- func (s *Server) ListenUDP(addr string) (err error)
- func (s *Server) Passages() (passages []server.Passage)
- func (s *Server) RemovePassages(passages []server.Passage, alsoManager bool) (err error)
- func (s *Server) SyncPassages(passages []server.Passage) (err error)
- type UDPConn
- type UDPConnMapping
- type UserContext
- type UserContextPool
Constants ¶
View Source
const ( // BasicLen is the basic auth length of [salt][encrypted payload length][length tag][encrypted payload][payload tag] BasicLen = 32 + 2 + 16 TCPBufferSize = 32 * 1024 )
Variables ¶
This section is empty.
Functions ¶
func LocalizePassages ¶
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) ContentionCheck ¶ added in v0.1.9
func (*Server) GetOrBuildUDPConn ¶ added in v1.1.6
func (s *Server) GetOrBuildUDPConn(lAddr net.Addr, data []byte) (rc net.PacketConn, passage *Passage, plainText []byte, target string, err error)
GetOrBuildUDPConn get a UDP conn from the mapping. plainText is from pool and starts with metadata. Please MUST put it back.
func (*Server) GetUserContextOrInsert ¶
func (s *Server) GetUserContextOrInsert(userIP string) *UserContext
func (*Server) RemovePassages ¶
type UDPConn ¶
type UDPConn struct { Establishing chan struct{} Timeout time.Duration net.PacketConn }
func NewUDPConn ¶
func NewUDPConn(conn net.PacketConn) *UDPConn
type UDPConnMapping ¶
func NewUDPConnMapping ¶
func NewUDPConnMapping() *UDPConnMapping
func (*UDPConnMapping) Insert ¶
func (m *UDPConnMapping) Insert(key string, val net.PacketConn) *UDPConn
pass val=nil for stating it is establishing
func (*UDPConnMapping) Remove ¶
func (m *UDPConnMapping) Remove(key string)
type UserContext ¶
UserContext is the context of a user which indicates the preferred servers
func NewUserContext ¶
func NewUserContext(passages []Passage) *UserContext
func (*UserContext) Close ¶
func (ctx *UserContext) Close() error
func (*UserContext) Infra ¶
func (ctx *UserContext) Infra() *lrulist.LruList
type UserContextPool ¶
UserContextPool is a pool which saves the UserContext and eliminates unused UserContext over time
func (*UserContextPool) Infra ¶
func (pool *UserContextPool) Infra() *lru.LRU
Click to show internal directories.
Click to hide internal directories.