Documentation ¶
Index ¶
- Constants
- Variables
- func ClientConnect(wsURL string, headers http.Header, dialer *websocket.Dialer, ...)
- func DefaultErrorWriter(rw http.ResponseWriter, req *http.Request, code int, err error)
- type Authorizer
- type ConnectAuthorizer
- type Dialer
- type ErrorWriter
- type Server
- func (s *Server) AddPeer(url, id, token string)
- func (s *Server) Dial(clientKey string, deadline time.Duration, proto, address string) (net.Conn, error)
- func (s *Server) Dialer(clientKey string, deadline time.Duration) Dialer
- func (s *Server) HasSession(clientKey string) bool
- func (s *Server) RemovePeer(id string)
- func (s *Server) ServeHTTP(rw http.ResponseWriter, req *http.Request)
- type Session
Constants ¶
View Source
const ( Data messageType = iota + 1 Connect Error AddClient RemoveClient )
Variables ¶
View Source
var ( Token = "X-API-Tunnel-Token" ID = "X-API-Tunnel-ID" )
View Source
var ( PingWaitDuration = time.Duration(10 * time.Second) PingWriteInterval = time.Duration(5 * time.Second) MaxRead = 8192 )
View Source
var PrintTunnelData bool
PrintTunnelData No tunnel logging by default
Functions ¶
func ClientConnect ¶
func DefaultErrorWriter ¶
Types ¶
type Authorizer ¶
type ConnectAuthorizer ¶
type ErrorWriter ¶
type Server ¶
func New ¶
func New(auth Authorizer, errorWriter ErrorWriter) *Server
func (*Server) HasSession ¶
func (*Server) RemovePeer ¶
type Session ¶
func NewClientSession ¶
func NewClientSession(auth ConnectAuthorizer, conn *websocket.Conn) *Session
Source Files ¶
Click to show internal directories.
Click to hide internal directories.