Skip to content

HTTP

[!NOTE] This document is partially generated by AI.

The HTTP proxy protocol allows clients to relay their web traffic (and other traffic via the CONNECT method) through a proxy server. In yuhaiin, it is supported as both an outbound and an inbound protocol.

  • TCP: Supported natively.
  • UDP: Not supported natively by the HTTP proxy protocol itself.

To use a remote HTTP proxy, the http protocol block uses these fields:

  • user (string): The username for Basic Authentication.
  • password (string): The password for Basic Authentication.

Like most outbounds, an HTTP client needs a simple layer to specify the proxy server’s address.


yuhaiin can function as an HTTP proxy server.

  • user (string): (Optional) The username required for incoming proxy connections.
  • password (string): (Optional) The password required for incoming proxy connections.

The HTTP server requires a tcpudp listener to bind to a local address and port.

{
"name": "HTTP-Proxy-Client",
"protocols": [
{ "simple": { "host": "proxy.provider.com", "port": 8080 } },
{ "http": { "user": "myuser", "password": "mypassword" } }
]
}
{
"name": "HTTP-Proxy-Server",
"enabled": true,
"tcpudp": { "host": "127.0.0.1:8080" },
"http": { "user": "admin", "password": "serverpassword" }
}

The HTTP proxy implementation supports the CONNECT method for tunneling any TCP traffic and standard mapping of GET, POST, etc., for standard web requests.

Found in pkg/net/proxy/http. It is highly performant and handles the standard Proxy-Authorization headers.