Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the provider client.
type Config ¶
type Config struct {
BrokerURL string
Endpoint string
PollInterval time.Duration
RetryBackoff time.Duration
DialTimeout time.Duration
ScrubHeaders bool
InsecureSkipVerify bool // Skip TLS certificate verification
AuthToken string // Authentication token for broker
// CoalesceWindow is passed through to pollmux.Connector; <= 0 uses
// pollmux.DefaultCoalesceWindow.
CoalesceWindow time.Duration
// PollMode is "" or "stream" (default) to request stream mode, or
// "batch" to opt out and force the older discrete poll mode.
PollMode string
// PollGrace is passed through to pollmux.Connector; <= 0 uses
// pollmux.DefaultPollGrace. Raise it when the broker sits behind a
// reverse proxy/CDN whose own latency can push a stream-mode poll's
// response headers past the default 10s.
PollGrace time.Duration
// UploadStreamPreference is passed through to
// pollmux.Connector.UploadStreamPreference: "" (default) auto-detects,
// "stream" forces it, "batch" disables it. See that field's doc.
UploadStreamPreference string
// UploadProbeTimeout is passed through to
// pollmux.Connector.UploadProbeTimeout; <= 0 uses pollmux's default (15s).
UploadProbeTimeout time.Duration
// PreferWebSocket is passed through to pollmux.Connector.PreferWebSocket.
// Takes effect only if the broker also has EnableWebSocket on; otherwise
// negotiation falls back to PollMode as if this were false.
PreferWebSocket bool
}
Config holds provider configuration.
type ScrubConn ¶
ScrubConn wraps a net.Conn and scrubs proxy headers from HTTP requests. For TLS or non-HTTP traffic, it passes through unchanged.
func NewScrubConn ¶
NewScrubConn wraps conn with HTTP proxy header scrubbing.
type StreamHandler ¶
type StreamHandler struct {
// contains filtered or unexported fields
}
StreamHandler handles a single tunnel stream from the broker.
func NewStreamHandler ¶
func NewStreamHandler( dialTimeout time.Duration, scrubHeaders bool, logger *zap.Logger, ) *StreamHandler
NewStreamHandler creates a new StreamHandler.
func (*StreamHandler) Handle ¶
func (h *StreamHandler) Handle(stream net.Conn)
Handle reads the target address, dials the target, and bridges the stream. This runs in its own goroutine per stream.
Click to show internal directories.
Click to hide internal directories.