kinetex - v1.0.0-rc.1
    Preparing search index...

    Function socks5Connector

    • Higher-order connector: wraps any TcpConnector with 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.

      Parameters

      Returns TcpConnector

      A TcpConnector that tunnels all connections through the SOCKS5 proxy.

      Delegates to createSocks5Tunnel — see its errors.

      // 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.