SOCKS5 proxy connection parameters.
The underlying TCP connector to wrap.
A TcpConnector that tunnels all connections through the SOCKS5 proxy.
// With Deno
const client = new HttpClient({
connector: socks5Connector(
{ host: "127.0.0.1", port: 1080 },
denoTcpConnector,
),
});
// With Node.js
const client = new HttpClient({
connector: socks5Connector(
{ host: "proxy.example", port: 1080, username: "user", password: "pass" },
nodeTcpConnector,
),
});
For clients without connector support, use createSocks5Tunnel directly.
Higher-order connector: wraps any
TcpConnectorwith SOCKS5 tunnelling.Drop this into an HTTP client that accepts a custom TCP connector factory. The returned connector creates a SOCKS5 tunnel to the proxy, then forwards all TCP traffic through that tunnel.