Documentation
¶
Overview ¶
Package httpproxy opens TCP tunnels through an HTTP proxy using CONNECT.
It sits in a neutral package because both callers need it and neither can hold it: ws cannot import host/internal, since host/internal imports server and server imports ws.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Dial ¶
Dial opens a TCP tunnel to addr through the HTTP proxy at proxyURL. The context bounds the dial and the CONNECT exchange, not the lifetime of the returned connection: its deadline, and a cancel too.
func WebSocketServerURL ¶
WebSocketServerURL formats host as a wss:// --server value.
Exported because the CONNECT refusal here and the dial-failure hint in host/internal both suggest one, and a bare IPv6 address needs bracketing to be a valid authority — "wss://2001:db8::1" is not a URL either of them could have accepted back.
func WithCause ¶ added in v0.35.0
WithCause wraps err in ctx's error when ctx is what failed a dial or a CONNECT exchange: closed says its close-on-cancel ran, and a socket timeout once ctx's deadline has passed is the deadline the socket copied from ctx. A failure ctx had no part in keeps its own error, so a cancel that merely coincides with it cannot hide it.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package httpproxytest provides a stub HTTP CONNECT proxy for tests.
|
Package httpproxytest provides a stub HTTP CONNECT proxy for tests. |