Help us shape the future of Go! Take the 2026 Go Developer Survey

httpproxy

package
v0.32.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

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

func Dial(ctx context.Context, proxyURL *url.URL, addr string) (net.Conn, error)

Dial opens a TCP tunnel to addr through the HTTP proxy at proxyURL. The context's deadline bounds the dial and the CONNECT exchange, not the lifetime of the returned connection.

func WebSocketServerURL

func WebSocketServerURL(host string) string

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.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL