Documentation ¶
Index ¶
- Constants
- Variables
- func ConnectConns(downstreamConn connCloseWriter, upstreamConn connCloseWriter)
- type Client
- type ClientConfig
- type ClientMux
- type ClientSession
- func (s *ClientSession) DialUDP(network string, dstAddr *net.UDPAddr) (*UDPConn, error)
- func (s *ClientSession) GetTunnelConfig() TunnelConfig
- func (s *ClientSession) Listen(network, address string) (*Listener, error)
- func (s *ClientSession) ListenUDP(network string, udpAddr *net.UDPAddr) (*UDPConn, error)
- type DialRequest
- type DialResponse
- type Forward
- type ForwardManager
- type ListenRequest
- type ListenResponse
- type Listener
- type MessageType
- type MuxadoTunnel
- func NewTlsMuxadoClientTunnel(tunnelReq TunnelRequest) (*MuxadoTunnel, error)
- func NewTlsMuxadoServerTunnel(tlsConn *tls.Conn, jose *josencillo.JOSE, public bool) (*MuxadoTunnel, error)
- func NewWebSocketMuxadoServerTunnel(w http.ResponseWriter, r *http.Request, jose *josencillo.JOSE, public bool, ...) (*MuxadoTunnel, error)
- type OAuth2AuthUriEvent
- type OAuth2Handler
- type OmnistreamsTunnel
- func (t *OmnistreamsTunnel) AcceptStream() (connCloseWriter, error)
- func (t *OmnistreamsTunnel) AcceptStreamType() (connCloseWriter, MessageType, error)
- func (t *OmnistreamsTunnel) GetConfig() TunnelConfig
- func (t *OmnistreamsTunnel) HandleRequests(callback func(interface{}) interface{}) error
- func (t *OmnistreamsTunnel) OpenStream() (connCloseWriter, error)
- func (t *OmnistreamsTunnel) OpenStreamType(msgType MessageType) (connCloseWriter, error)
- func (t *OmnistreamsTunnel) ReceiveDatagram() ([]byte, net.Addr, net.Addr, error)
- func (t *OmnistreamsTunnel) Request(req interface{}) (interface{}, error)
- func (t *OmnistreamsTunnel) SendDatagram(msg []byte, srcAddr, dstAddr net.Addr) error
- func (t *OmnistreamsTunnel) SendMessage(msg interface{}) (interface{}, error)
- type PassthroughListener
- type ProxyConn
- func (c ProxyConn) Close() error
- func (c ProxyConn) CloseWrite() error
- func (c ProxyConn) LocalAddr() net.Addr
- func (c ProxyConn) Read(p []byte) (int, error)
- func (c ProxyConn) RemoteAddr() net.Addr
- func (c ProxyConn) SetDeadline(t time.Time) error
- func (c ProxyConn) SetReadDeadline(t time.Time) error
- func (c ProxyConn) SetWriteDeadline(t time.Time) error
- func (c ProxyConn) Write(p []byte) (int, error)
- type Server
- type ServerConfig
- type ServerMux
- type TokenFlow
- type Tunnel
- type TunnelConfig
- type TunnelConnectedEvent
- type TunnelRequest
- type UDPConn
- type UsersUpdatedEvent
- type WebTransportTunnel
- func (t *WebTransportTunnel) AcceptStream() (connCloseWriter, error)
- func (t *WebTransportTunnel) AcceptStreamType() (connCloseWriter, MessageType, error)
- func (t *WebTransportTunnel) GetConfig() TunnelConfig
- func (t *WebTransportTunnel) HandleRequests(callback func(interface{}) interface{}) error
- func (t *WebTransportTunnel) OpenStream() (connCloseWriter, error)
- func (t *WebTransportTunnel) OpenStreamType(msgType MessageType) (connCloseWriter, error)
- func (t *WebTransportTunnel) ReceiveDatagram() ([]byte, net.Addr, net.Addr, error)
- func (t *WebTransportTunnel) Request(req interface{}) (interface{}, error)
- func (t *WebTransportTunnel) SendDatagram(msg []byte, srcAddr, dstAdd net.Addr) error
Constants ¶
View Source
const ( MessageTypeTunnelConfig = iota MessageTypeSuccess MessageTypeListen MessageTypeStream MessageTypeDial MessageTypeError )
View Source
const ListenerDefaultKey = "default-listener"
View Source
const PROXY_PROTO_PP2_TYPE_MIN_CUSTOM = 0xe0
View Source
const PROXY_PROTO_SERVER_NAME_OFFSET = PROXY_PROTO_PP2_TYPE_MIN_CUSTOM + 0
View Source
const WebTransportCodeCancel = 0
Variables ¶
View Source
var ( DefaultToken string = "" DefaultCertDir string = "./" DebugMode bool = false )
View Source
var WaygateServerDomain string = "waygate.io"
Functions ¶
func ConnectConns ¶
func ConnectConns(downstreamConn connCloseWriter, upstreamConn connCloseWriter)
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(config *ClientConfig) *Client
func (*Client) ListenEvents ¶
func (c *Client) ListenEvents(eventCh chan interface{})
type ClientConfig ¶
type ClientMux ¶
type ClientMux struct {
// contains filtered or unexported fields
}
func NewClientMux ¶
func NewClientMux(authServer *obligator.Server, fileServer *gemdrive.Server, forwardMan *ForwardManager) *ClientMux
func (*ClientMux) HandleFunc ¶
type ClientSession ¶
type ClientSession struct {
// contains filtered or unexported fields
}
func NewClientSession ¶
func NewClientSession(token, certDir string) (*ClientSession, error)
func (*ClientSession) GetTunnelConfig ¶
func (s *ClientSession) GetTunnelConfig() TunnelConfig
type DialRequest ¶
type DialResponse ¶
type ForwardManager ¶
type ForwardManager struct {
// contains filtered or unexported fields
}
func NewForwardManager ¶
func NewForwardManager() *ForwardManager
func (*ForwardManager) GetAll ¶
func (m *ForwardManager) GetAll() map[string]*Forward
func (*ForwardManager) Set ¶
func (m *ForwardManager) Set(domain string, forward *Forward)
type ListenRequest ¶
type ListenResponse ¶
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
func ListenWithOpts ¶
func (*Listener) GetTunnelConfig ¶
func (l *Listener) GetTunnelConfig() TunnelConfig
type MessageType ¶
type MessageType uint8
func (MessageType) String ¶
func (t MessageType) String() string
type MuxadoTunnel ¶
type MuxadoTunnel struct {
// contains filtered or unexported fields
}
func NewTlsMuxadoClientTunnel ¶
func NewTlsMuxadoClientTunnel(tunnelReq TunnelRequest) (*MuxadoTunnel, error)
func NewTlsMuxadoServerTunnel ¶
func NewTlsMuxadoServerTunnel(tlsConn *tls.Conn, jose *josencillo.JOSE, public bool) (*MuxadoTunnel, error)
func NewWebSocketMuxadoServerTunnel ¶
func NewWebSocketMuxadoServerTunnel( w http.ResponseWriter, r *http.Request, jose *josencillo.JOSE, public bool, tunnelDomains []string, ) (*MuxadoTunnel, error)
func (*MuxadoTunnel) AcceptStream ¶
func (t *MuxadoTunnel) AcceptStream() (connCloseWriter, error)
func (*MuxadoTunnel) GetConfig ¶
func (t *MuxadoTunnel) GetConfig() TunnelConfig
func (*MuxadoTunnel) OpenStream ¶
func (t *MuxadoTunnel) OpenStream() (connCloseWriter, error)
type OAuth2AuthUriEvent ¶
type OAuth2AuthUriEvent struct {
Uri string
}
type OAuth2Handler ¶
type OAuth2Handler struct {
// contains filtered or unexported fields
}
func NewOAuth2Handler ¶
func NewOAuth2Handler(prefix string, jose *josencillo.JOSE) *OAuth2Handler
func (*OAuth2Handler) ServeHTTP ¶
func (h *OAuth2Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type OmnistreamsTunnel ¶
type OmnistreamsTunnel struct {
// contains filtered or unexported fields
}
func NewOmnistreamsClientTunnel ¶
func NewOmnistreamsClientTunnel(tunReq TunnelRequest) (*OmnistreamsTunnel, error)
func NewOmnistreamsServerTunnel ¶
func NewOmnistreamsServerTunnel( w http.ResponseWriter, r *http.Request, jose *josencillo.JOSE, public bool, tunnelDomains []string, ) (*OmnistreamsTunnel, error)
func (*OmnistreamsTunnel) AcceptStream ¶
func (t *OmnistreamsTunnel) AcceptStream() (connCloseWriter, error)
func (*OmnistreamsTunnel) AcceptStreamType ¶
func (t *OmnistreamsTunnel) AcceptStreamType() (connCloseWriter, MessageType, error)
func (*OmnistreamsTunnel) GetConfig ¶
func (t *OmnistreamsTunnel) GetConfig() TunnelConfig
func (*OmnistreamsTunnel) HandleRequests ¶
func (t *OmnistreamsTunnel) HandleRequests(callback func(interface{}) interface{}) error
func (*OmnistreamsTunnel) OpenStream ¶
func (t *OmnistreamsTunnel) OpenStream() (connCloseWriter, error)
func (*OmnistreamsTunnel) OpenStreamType ¶
func (t *OmnistreamsTunnel) OpenStreamType(msgType MessageType) (connCloseWriter, error)
func (*OmnistreamsTunnel) ReceiveDatagram ¶
func (*OmnistreamsTunnel) Request ¶
func (t *OmnistreamsTunnel) Request(req interface{}) (interface{}, error)
func (*OmnistreamsTunnel) SendDatagram ¶
func (t *OmnistreamsTunnel) SendDatagram(msg []byte, srcAddr, dstAddr net.Addr) error
func (*OmnistreamsTunnel) SendMessage ¶
func (t *OmnistreamsTunnel) SendMessage(msg interface{}) (interface{}, error)
type PassthroughListener ¶
type PassthroughListener struct {
// contains filtered or unexported fields
}
func NewPassthroughListener ¶
func NewPassthroughListener() *PassthroughListener
func (*PassthroughListener) Addr ¶
func (f *PassthroughListener) Addr() net.Addr
func (*PassthroughListener) Close ¶
func (f *PassthroughListener) Close() error
func (*PassthroughListener) PassConn ¶
func (f *PassthroughListener) PassConn(conn net.Conn)
type ProxyConn ¶
type ProxyConn struct {
// contains filtered or unexported fields
}
This type creates a new net.Conn that's the same as an old one, except a new reader is provided. So it proxies every method except Read. This is necessary because by calling peekClientHello, part of the reader is read, so we need to create a new reader with the already read data inserted back in the front. I'm sure there's a cleaner way to do this...
func (ProxyConn) Close ¶
TODO: is this safe? Will it actually close properly, or does it need to be connected to the reader somehow?
func (ProxyConn) CloseWrite ¶
func (ProxyConn) RemoteAddr ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(config *ServerConfig) *Server
type ServerConfig ¶
type ServerMux ¶
type ServerMux struct {
// contains filtered or unexported fields
}
func (*ServerMux) HandleFunc ¶
type TokenFlow ¶
type TokenFlow struct {
// contains filtered or unexported fields
}
func NewTokenFlow ¶
func (*TokenFlow) GetAuthUri ¶
type Tunnel ¶
type Tunnel interface { OpenStream() (connCloseWriter, error) OpenStreamType(MessageType) (connCloseWriter, error) AcceptStream() (connCloseWriter, error) AcceptStreamType() (connCloseWriter, MessageType, error) GetConfig() TunnelConfig Request(req interface{}) (interface{}, error) HandleRequests(callback func(interface{}) interface{}) error SendDatagram(msg []byte, srcAddr, dstAddr net.Addr) error ReceiveDatagram() ([]byte, net.Addr, net.Addr, error) }
type TunnelConfig ¶
type TunnelConnectedEvent ¶
type TunnelConnectedEvent struct {
TunnelConfig TunnelConfig
}
type TunnelRequest ¶
type UsersUpdatedEvent ¶
type WebTransportTunnel ¶
type WebTransportTunnel struct {
// contains filtered or unexported fields
}
func NewWebTransportClientTunnel ¶
func NewWebTransportClientTunnel(tunnelReq TunnelRequest) (*WebTransportTunnel, error)
func NewWebTransportServerTunnel ¶
func NewWebTransportServerTunnel( w http.ResponseWriter, r *http.Request, wtServer webtransport.Server, jose *josencillo.JOSE, public bool, tunnelDomains []string, ) (*WebTransportTunnel, error)
func (*WebTransportTunnel) AcceptStream ¶
func (t *WebTransportTunnel) AcceptStream() (connCloseWriter, error)
func (*WebTransportTunnel) AcceptStreamType ¶
func (t *WebTransportTunnel) AcceptStreamType() (connCloseWriter, MessageType, error)
func (*WebTransportTunnel) GetConfig ¶
func (t *WebTransportTunnel) GetConfig() TunnelConfig
func (*WebTransportTunnel) HandleRequests ¶
func (t *WebTransportTunnel) HandleRequests(callback func(interface{}) interface{}) error
func (*WebTransportTunnel) OpenStream ¶
func (t *WebTransportTunnel) OpenStream() (connCloseWriter, error)
func (*WebTransportTunnel) OpenStreamType ¶
func (t *WebTransportTunnel) OpenStreamType(msgType MessageType) (connCloseWriter, error)
func (*WebTransportTunnel) ReceiveDatagram ¶
func (*WebTransportTunnel) Request ¶
func (t *WebTransportTunnel) Request(req interface{}) (interface{}, error)
func (*WebTransportTunnel) SendDatagram ¶
func (t *WebTransportTunnel) SendDatagram(msg []byte, srcAddr, dstAdd net.Addr) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.