Documentation ¶
Index ¶
- Constants
- Variables
- func ClientConnect(ctx context.Context, wsURL string, headers http.Header, tlsConfig *tls.Config, ...)
- func DefaultErrorWriter(rw http.ResponseWriter, req *http.Request, code int, err error)
- type Authorizer
- type CleanCredentials
- 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 = "BCS-API-Tunnel-Token" ID = "BCS-API-Tunnel-ID" )
View Source
var PrintTunnelData bool
PrintTunnelData No tunnel logging by default
Functions ¶
func ClientConnect ¶
func DefaultErrorWriter ¶
Types ¶
type Authorizer ¶
type CleanCredentials ¶
type CleanCredentials func(clientKey string)
type ConnectAuthorizer ¶
type ErrorWriter ¶
type Server ¶
func New ¶
func New(auth Authorizer, errorWriter ErrorWriter, clean CleanCredentials) *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.