TooTallNate / proxy-agents

Node.js HTTP Proxy Agents Monorepo
https://proxy-agents.n8.io
872 stars 229 forks source link

[socks-proxy-agent] pass `socket_options` to `SocksClient` #241

Closed lukekarrys closed 3 months ago

lukekarrys commented 10 months ago

This PR adds the option socketOptions which will get passed along to SocksClient.createConnection as socket_options.

Another solution would be to spread all the unused constructor options to the SocksClient.createConnection options since there are a few more that are allowed. I didn't go this route since I only have a use case for socket_options and I didn't want to couple the two APIs too closely. But I'd be happy to rework this PR if desired.

For reference the SocksClientOptions interface is:

interface SocksClientOptions {
    command: SocksCommandOption;
    destination: SocksRemoteHost;
    proxy: SocksProxy;
    timeout?: number;
    existing_socket?: Duplex;
    set_tcp_nodelay?: boolean;
    socket_options?: SocketConnectOpts;
}
changeset-bot[bot] commented 10 months ago

🦋 Changeset detected

Latest commit: 09cac544e55f34783452e29f7d28a2da095d4162

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ----------------- | ----- | | socks-proxy-agent | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

vercel[bot] commented 10 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
proxy-agents ✅ Ready (Inspect) Visit Preview Aug 30, 2023 7:39pm
lukekarrys commented 9 months ago

@TooTallNate Any thoughts on this PR? Happy to rework it based on any feedback you might have.

lukekarrys commented 3 months ago

Deleted my fork before I realized this PR was attached to it. Reopened as #302.