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.
Network Support
Section titled “Network Support”- TCP: Supported natively.
- UDP: Not supported natively by the HTTP proxy protocol itself.
Client Configuration (Outbound)
Section titled “Client Configuration (Outbound)”To use a remote HTTP proxy, the http protocol block uses these fields:
Configuration Fields
Section titled “Configuration Fields”user(string): The username for Basic Authentication.password(string): The password for Basic Authentication.
Protocol Chain Context
Section titled “Protocol Chain Context”Like most outbounds, an HTTP client needs a simple layer to specify the proxy server’s address.
Server Configuration (Inbound)
Section titled “Server Configuration (Inbound)”yuhaiin can function as an HTTP proxy server.
Configuration Fields
Section titled “Configuration Fields”user(string): (Optional) The username required for incoming proxy connections.password(string): (Optional) The password required for incoming proxy connections.
Listener Configuration
Section titled “Listener Configuration”The HTTP server requires a tcpudp listener to bind to a local address and port.
Example Configuration
Section titled “Example Configuration”Outbound Example
Section titled “Outbound Example”{ "name": "HTTP-Proxy-Client", "protocols": [ { "simple": { "host": "proxy.provider.com", "port": 8080 } }, { "http": { "user": "myuser", "password": "mypassword" } } ]}Inbound Example
Section titled “Inbound Example”{ "name": "HTTP-Proxy-Server", "enabled": true, "tcpudp": { "host": "127.0.0.1:8080" }, "http": { "user": "admin", "password": "serverpassword" }}Developer Details
Section titled “Developer Details”Functionality
Section titled “Functionality”The HTTP proxy implementation supports the CONNECT method for tunneling any TCP traffic and standard mapping of GET, POST, etc., for standard web requests.
Implementation
Section titled “Implementation”Found in pkg/net/proxy/http. It is highly performant and handles the standard Proxy-Authorization headers.