Documentation
¶
Index ¶
- Variables
- func CountUserTunnels(userId string) uint32
- func DeleteTunnel(userId, tunnelName string) error
- func GetTunnelsForUser(userId string) []string
- func HandleCreatePortTunnel(w http.ResponseWriter, r *http.Request, muxSession *yamux.Session, ...) error
- func HandleTunnel(w http.ResponseWriter, r *http.Request)
- func HandleWebTunnel(w http.ResponseWriter, r *http.Request)
- func ListenAndServe(listen string, tlsConfig *tls.Config)
- func Routes(router *http.ServeMux)
- func TunnelAgentPort(agentSessionId string, port uint16, conn net.Conn)
- type TunnelClient
- type TunnelOpts
- type TunnelType
Constants ¶
This section is empty.
Variables ¶
var TunnelLifecycleLogHook func(userId, username, tunnelLabel string, opened bool)
TunnelLifecycleLogHook is called when a tunnel opens or closes, so the pro build can mirror the lifecycle into the owner's log sinks (the audit events cover the audit trail; sinks only ever see log records). The OSS build leaves it nil.
var TunnelRequestLogHook func(userId, username, tunnelName, method, path, host string, status int, duration time.Duration)
TunnelRequestLogHook is called after each request proxied through a web tunnel, carrying the tunnel owner and the request outcome. The pro build assigns it (system-log forwarding + log-sink mirroring); the OSS build leaves it nil and tunnel requests are unlogged.
Functions ¶
func CountUserTunnels ¶ added in v0.12.3
func DeleteTunnel ¶ added in v0.15.2
func GetTunnelsForUser ¶ added in v0.12.7
func HandleCreatePortTunnel ¶ added in v0.18.0
func HandleTunnel ¶
func HandleTunnel(w http.ResponseWriter, r *http.Request)
func HandleWebTunnel ¶ added in v0.19.0
func HandleWebTunnel(w http.ResponseWriter, r *http.Request)
HandleWebTunnel handles web tunnel requests for domain-based routing
func ListenAndServe ¶
Start a web server to listen for connections to tunnels, the left most part of the domain is the <username>--<tunnel name>
Types ¶
type TunnelClient ¶ added in v0.18.0
type TunnelClient struct {
// contains filtered or unexported fields
}
func NewTunnelClient ¶ added in v0.18.0
func NewTunnelClient(wsServerUrl, serverUrl, token string, skipTLSVerify bool, opts *TunnelOpts) *TunnelClient
func (*TunnelClient) ConnectAndServe ¶ added in v0.18.0
func (c *TunnelClient) ConnectAndServe() error
func (*TunnelClient) GetCtx ¶ added in v0.18.0
func (c *TunnelClient) GetCtx() context.Context
func (*TunnelClient) Shutdown ¶ added in v0.18.0
func (c *TunnelClient) Shutdown()
func (*TunnelClient) URL ¶ added in v0.29.0
func (c *TunnelClient) URL() string
URL returns the public tunnel URL for a web tunnel once ConnectAndServe has resolved it. It is empty for port tunnels or before ConnectAndServe runs.
type TunnelOpts ¶ added in v0.18.0
type TunnelOpts struct {
Type TunnelType // Type of tunnel
Protocol string // http, https or tcp
LocalPort uint16 // The local port to forward to
TunnelName string // The name of the tunnel for web tunnels
SpaceName string // The name of the space for space tunnels
SpacePort uint16 // The port within the space being forwarded
TlsName string // The name to present to TLS ports
TlsSkipVerify bool // Don't verify TLS of the local port
}
type TunnelType ¶ added in v0.18.0
type TunnelType int
const ( WebTunnel TunnelType = iota PortTunnel )