Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultTarget ¶
DefaultTarget returns the default localhost URL for a given port.
func HandleRequest ¶
func HandleRequest(req types.TunnelRequest, upstream string) types.TunnelResponse
HandleRequest proxies a tunnel request to the given upstream base URL.
Types ¶
type UpstreamResolver ¶
UpstreamResolver returns the upstream base URL for a WS open, or "" for default.
type WSRelay ¶
type WSRelay struct {
// contains filtered or unexported fields
}
WSRelay manages proxied visitor WebSocket sessions for a single tunnel connection.
func NewWSRelay ¶
func NewWSRelay(defaultUpstream string, subdomain string, writeJSON func(v any) error, resolve UpstreamResolver, pipeline interface { NotifyWSFrame(subdomain, sessionID, direction string, isText bool, payload string, size int) NotifyWSSessionStart(subdomain, sessionID string, sender func(isText bool, payload []byte) error) NotifyWSSessionEnd(subdomain, sessionID string) }) *WSRelay
func (*WSRelay) HandleClose ¶
HandleClose closes a local WebSocket session.
func (*WSRelay) HandleFrame ¶
HandleFrame forwards a tunnel frame to the local WebSocket.
func (*WSRelay) HandleOpen ¶
HandleOpen dials the upstream WebSocket server and starts relaying frames.
Click to show internal directories.
Click to hide internal directories.