Documentation
¶
Overview ¶
Package ws wraps github.com/coder/websocket behind EdgeFetch's outbound control-plane contract: HTTP/1.1 ALPN upgrade, classic ECDHE TLS curves, zero ambient proxy inheritance, no redirect token leakage, disabled per-message compression, 1 MiB message ceiling, and io.EOF peer-close normalization.
Index ¶
Constants ¶
const (
MaxMessageBytes = 1 << 20 // 1 MiB ceiling on Hub control-plane frames
)
Variables ¶
This section is empty.
Functions ¶
func ClassicTLSConfig ¶
ClassicTLSConfig pins ECDHE curves (`X25519`, `P-256`, `P-384`) so post-quantum hybrid key shares do not push TLS `ClientHello` packets past PPPoE, WireGuard, or VM NAT bridge MTU limits.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn wraps an active outbound client WebSocket connection.
func Dial ¶
func Dial(ctx context.Context, rawURL, userAgent string, extraHeaders map[string]string) (*Conn, error)
Dial opens an outbound HTTP/1.1 WebSocket connection (`wss://`, `https://`, `ws://`, or `http://`).
func DialWithOptions ¶
func DialWithOptions(ctx context.Context, rawURL, userAgent string, extraHeaders map[string]string, opts DialOptions) (*Conn, error)
DialWithOptions opens an outbound WebSocket connection with optional TLS root CA overrides for local TLS tests.
func (*Conn) CloseCleanly ¶
CloseCleanly sends an RFC 6455 `1000` normal closure frame and closes the underlying connection.
func (*Conn) CloseNow ¶
CloseNow closes the underlying TCP/TLS socket immediately without waiting for a close handshake.
func (*Conn) ReadText ¶
ReadText reads the next message with `readTimeout`, mapping any peer WebSocket close frame cleanly to `io.EOF`.
func (*Conn) SetReadLimit ¶
SetReadLimit overrides the maximum incoming WebSocket message size in bytes.
type DialOptions ¶
DialOptions allows tests to supply custom TLS root CAs while preserving all transport hardening invariants.