Categorygithub.com/mwitkow/go-http-dialer
modulepackage
0.0.0-20161116154839-378f744fb2b8
Repository: https://github.com/mwitkow/go-http-dialer.git
Documentation: pkg.go.dev

# README

HTTP CONNECT tunneling Go Dialer

Travis Build Go Report Card GoDoc Apache 2.0 License

A net.Dialer drop-in that establishes the TCP connection over an HTTP CONNECT Tunnel.

Why?!

Some enterprises have fairly restrictive networking environments. They typically operate HTTP forward proxies that require user authentication. These proxies usually allow HTTPS (TCP to :443) to pass through the proxy using the CONNECT method. The CONNECT method is basically a HTTP-negotiated "end-to-end" TCP stream... which is exactly what net.Conn is :)

But, really, why?

Because if you want to call gRPC services which are exposed publicly over :443 TLS over an HTTP proxy, you can't.

Also, this allows you to call any TCP service over HTTP CONNECT... if your proxy allows you to ¯\(ツ)/¯

Supported features

  • unencrypted connection to proxy (e.g. http://proxy.example.com:3128
  • TLS connection to proxy (customizeable) (e.g. https://proxy.example.com)
  • customizeable for Proxy-Authenticate, with challenge-response semantics
  • out of the box support for Basic auth
  • appropriate RemoteAddr remapping

Usage with gRPC

License

go-http-dialer is released under the Apache 2.0 license. See the LICENSE file for details.

# Packages

No description provided by the author

# Functions

AuthBasic returns a ProxyAuthorization that implements "Basic" protocol while ignoring realm challanges.
New constructs an HttpTunnel to be used a net.Dial command.
WithConnectionTimeout customizes the underlying net.Dialer.Timeout.
WithDialer allows the customization of the underlying net.Dialer used for establishing TCP connections to the proxy.
WithProxyAuth allows you to add ProxyAuthorization to calls.
WithTls sets the tls.Config to be used (e.g.

# Structs

HttpTunnel represents a configured HTTP Connect Tunnel dialer.

# Interfaces

ProxyAuthorization allows for plugging in arbitrary implementations of the "Proxy-Authorization" handler.