Documentation ¶
Index ¶
- Variables
- func AcceptConnection(conn net.Conn, manager cert.TlsConfig, secure bool, channels Channels) error
- func DefaultListenerFromPacketConn(block kcp.BlockCrypt, conn net.PacketConn) (net.Listener, error)
- type AbstractChannel
- type Channel
- type Channels
- func (chl *Channels) Filter(names []string) (Channels, error)
- func (chl *Channels) Find(name string) (Channel, error)
- func (chl *Channels) String() string
- func (chl *Channels) UnmarshalFlag(endpoint string) error
- func (chl *Channels) UnmarshalJSON(b []byte) error
- func (chl *Channels) UnmarshalYAML(unmarshal func(interface{}) error) error
- type ConnectionHandler
- type DnsServer
- type HttpEndpoint
- type HttpServer
- type IoServer
- type ListenerFromPacketConn
- type NetworkChannel
- type NextHandlerFunc
- type PacketServer
- type Server
- type Servers
- type SocketServer
- type SocksChannel
- type WebsocketEndpointList
Constants ¶
This section is empty.
Variables ¶
var ChannelRegex = regexp.MustCompile("^(/[a-z0-9_^/]*)->((tcp|udp|unix|unixgram|unixpacket):(.*))$")
Functions ¶
func AcceptConnection ¶
func DefaultListenerFromPacketConn ¶ added in v2.1.0
func DefaultListenerFromPacketConn(block kcp.BlockCrypt, conn net.PacketConn) (net.Listener, error)
Types ¶
type AbstractChannel ¶
type AbstractChannel struct { addr.ProtoName `yaml:",inline"` Address addr.ProtoAddress `json:"address"` }
func (*AbstractChannel) Name ¶
func (u *AbstractChannel) Name() string
type Channels ¶
type Channels []Channel
func (*Channels) Filter ¶
Filter will return a list of channels if they are contained in the list of names. It will throw an error if no channels can be identified (either this list is empty or no match if found). If the list of names is empty or nil, it will return all the channels
func (*Channels) Find ¶
Find finds an endpoint by name (case sensitive). If the endpoint does not exist, it returns an error
func (*Channels) UnmarshalFlag ¶
func (*Channels) UnmarshalJSON ¶
func (*Channels) UnmarshalYAML ¶
type ConnectionHandler ¶
type ConnectionHandler struct {
// contains filtered or unexported fields
}
ConnectionHandler will overlay a logical connection multiplexer over a pyhisical line
func (*ConnectionHandler) HandleConnection ¶
func (ch *ConnectionHandler) HandleConnection(conn net.Conn) (err error)
Create a logical mutex session of a pyhisical link
type DnsServer ¶
type DnsServer struct { SocketServer Domain string `json:"domain"` }
func NewDnsServer ¶
func NewDnsServer() *DnsServer
type HttpEndpoint ¶
type HttpEndpoint struct { Channels []string `json:"channels"` Endpoint string `json:"endpoint"` EnableCompression bool `json:"enableCompression"` }
func (*HttpEndpoint) String ¶
func (wsm *HttpEndpoint) String() string
type HttpServer ¶
type HttpServer struct { cert.ServerConfig Address addr.ProtoAddress `json:"address"` Endpoints WebsocketEndpointList `json:"endpoints"` // contains filtered or unexported fields }
func NewHttpServer ¶
func NewHttpServer() *HttpServer
func (*HttpServer) EndpointHandler ¶
func (ws *HttpServer) EndpointHandler(ep *HttpEndpoint, upstreams Channels) (http.HandlerFunc, error)
func (*HttpServer) Shutdown ¶
func (ws *HttpServer) Shutdown() error
func (*HttpServer) Startup ¶
func (ws *HttpServer) Startup(channels Channels) error
noinspection GoUnusedParameter
func (*HttpServer) String ¶
func (ws *HttpServer) String() string
type IoServer ¶
type IoServer struct { cert.ServerConfig Address addr.ProtoAddress `json:"address"` Channels []string `json:"channels"` Input io.ReadCloser Output io.WriteCloser // contains filtered or unexported fields }
func NewIoServer ¶
func NewIoServer() *IoServer
type ListenerFromPacketConn ¶ added in v2.1.0
type ListenerFromPacketConn func(block kcp.BlockCrypt, conn net.PacketConn) (net.Listener, error)
type NetworkChannel ¶
type NetworkChannel struct {
AbstractChannel
}
Channel is a configuration of one of the server that are going to be multiplexed in the connection
func (*NetworkChannel) OpenConnection ¶
func (u *NetworkChannel) OpenConnection() (net.Conn, error)
OpenConnection will open a connection the the upstream server
func (*NetworkChannel) String ¶
func (u *NetworkChannel) String() string
type NextHandlerFunc ¶
func GetRequestLogger ¶
func GetRequestLogger(address *net.TCPAddr) (logger NextHandlerFunc)
type PacketServer ¶ added in v2.1.0
type PacketServer struct { cert.ServerConfig Address addr.ProtoAddress `json:"address"` Channels []string `json:"channels"` PacketConnection net.PacketConn // contains filtered or unexported fields }
func NewPacketServer ¶ added in v2.1.0
func NewPacketServer() *PacketServer
func (*PacketServer) Shutdown ¶ added in v2.1.0
func (st *PacketServer) Shutdown() error
func (*PacketServer) Startup ¶ added in v2.1.0
func (st *PacketServer) Startup(channels Channels) error
func (*PacketServer) StartupPacket ¶ added in v2.1.0
func (st *PacketServer) StartupPacket(channels Channels, createListenerFunc ListenerFromPacketConn) error
func (*PacketServer) String ¶ added in v2.1.0
func (st *PacketServer) String() string
type Servers ¶
type Servers []Server
func (*Servers) UnmarshalFlag ¶
func (*Servers) UnmarshalJSON ¶
func (*Servers) UnmarshalYAML ¶
type SocketServer ¶
type SocketServer struct { cert.ServerConfig Address addr.ProtoAddress `json:"address"` Channels []string `json:"channels"` // contains filtered or unexported fields }
func NewSocketServer ¶
func NewSocketServer() *SocketServer
func (*SocketServer) Shutdown ¶
func (st *SocketServer) Shutdown() error
func (*SocketServer) Startup ¶
func (st *SocketServer) Startup(channels Channels) error
func (*SocketServer) String ¶
func (st *SocketServer) String() string
type SocksChannel ¶
type SocksChannel struct {
AbstractChannel
}
func (*SocksChannel) OpenConnection ¶
func (u *SocksChannel) OpenConnection() (net.Conn, error)
func (*SocksChannel) String ¶
func (u *SocksChannel) String() string
type WebsocketEndpointList ¶
type WebsocketEndpointList []HttpEndpoint
func (*WebsocketEndpointList) String ¶
func (epl *WebsocketEndpointList) String() string