Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use hostname for socks agent #159

Merged
merged 1 commit into from Jun 1, 2022
Merged

fix: use hostname for socks agent #159

merged 1 commit into from Jun 1, 2022

Conversation

wraithgar
Copy link
Member

host was deprecated and removed in the next semver major

host was deprecated and removed in the next semver major
@@ -198,6 +198,9 @@ function getProxy (proxyUrl, opts, isHttps) {
return new HttpsProxyAgent(popts)
}
} else if (proxyUrl.protocol.startsWith('socks')) {
// socks-proxy-agent uses hostname not host
popts.hostname = popts.host
delete popts.host
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we removing host because it logs a warning if you pass both?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed it to err on the side of explicitness. Renaming versus copying. Otherwise I would have just added hostname to popts. I don't really like that though, that feels like succeeding by coincidence for either agent type.

@wraithgar wraithgar merged commit 331f9cb into main Jun 1, 2022
@wraithgar wraithgar deleted the gar/socks-hostname branch June 1, 2022 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants