Forward Proxy
AvailableProxyIntermediary HTTP/1.x forward proxy and HTTPS CONNECT tunnel built on the shared L4 TCP listener.
Purpose
Routes outbound client HTTP requests and opaque TLS/TCP streams through a configurable single-port Linux intermediary.
Implementation Details
- Reads and parses incoming HTTP/1.x headers up to 16 KB (HTTP1_HEADER_BUFFER_SIZE) using http1_read_and_parse_headers().
- For standard HTTP requests, extracts target host and port (defaulting to 80) from absolute-form URIs or the Host header, converts the URI to origin-form, filters Proxy-Connection and Expect headers, and forces Connection: close.
- Streams request bodies of arbitrary size using either Content-Length or Transfer-Encoding: chunked framing, including HTTP/1.1 100 Continue handling when Expect: 100-continue is present.
- For HTTPS CONNECT requests, resolves the authority target (defaulting to port 443), establishes an outbound TCP connection, replies with HTTP/1.1 200 Connection Established, and relays bidirectional traffic using select() with a 64 KB buffer (TUNNEL_BUFFER_SIZE).
Scope & Current Limitations
- —No proxy authentication, caching, ACL filtering, or SOCKS protocol support.
- —Uses IPv4 DNS resolution (AF_INET) via getaddrinfo() and opens a fresh upstream TCP socket per request.
- —Returns 400 Bad Request or 431 Request Header Fields Too Large on malformed or oversized headers.
{ "engine": { "backlog": 128 }, "services": { "forwardProxy": { "enabled": true, "listen_ip": "0.0.0.0", "listen_port": 8085 } }}