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

Add option to disable anonymizeProxy #420

Closed
c0bra opened this issue Jul 16, 2019 · 9 comments · Fixed by #425
Closed

Add option to disable anonymizeProxy #420

c0bra opened this issue Jul 16, 2019 · 9 comments · Fixed by #425

Comments

@c0bra
Copy link
Contributor

c0bra commented Jul 16, 2019

I'm using an https protocol proxy url and because apify forces all proxyUrls to use anonymizeProxy() this means I can't do it because the scheme is not http.

Could an option be added that disabled the anonymizeProxy() call? That would be awesome.

I've tested with a custom launchPuppeteerFunction and it works, but it's not ideal because I lose all the other stuff apify does for handling puppeteer.

@jancurn
Copy link
Member

jancurn commented Jul 16, 2019

Can you just try to change https:// in your proxy URL to http:// ? It should work. Please let me know whether it helped, we'll consider whether to support this by default.

@c0bra
Copy link
Contributor Author

c0bra commented Jul 16, 2019

Yea I tried that. It does not work.

@jancurn
Copy link
Member

jancurn commented Jul 16, 2019

I see. So you're trying to connect to an HTTP proxy over SSL, is that it? Apify SDK (internally through https://github.com/apifytech/proxy-chain package) only supports HTTPS tunneling via HTTP CONNECT method over a standard HTTP proxy. See this discussion for more details - https://stackoverflow.com/questions/45874515/what-is-https-proxy

@c0bra
Copy link
Contributor Author

c0bra commented Jul 16, 2019

Right I've seen that. If the call to anonymizeProxy is conditional it should work fine, though. No?

@jancurn
Copy link
Member

jancurn commented Jul 17, 2019

anonymizeProxy() is only called if the proxy URL contains username and password, since Chrome doesn't accept username/password for proxy (read more here). But anonymizeProxydoesn't support HTTP proxy over SSL protocol, so I was wondering, whether that's what you're using.

@c0bra
Copy link
Contributor Author

c0bra commented Jul 22, 2019

@jancurn I'm not sure that's true. Here, anonymizeProxy is being called with no check for username/password:

https://github.com/apifytech/apify-js/blob/8e8c93db4fcf471820d1047fac1e214b7ddb8839/src/puppeteer.js#L87

And the anonymizeProxy function itself checks for an http scheme before it checks for a username/password combo:

https://github.com/apifytech/proxy-chain/blob/080047fa10527fc71a75ce3bf1059ea1994bc108/src/anonymize_proxy.js#L22

Edit: I think if the username/password check was moved above the scheme check it would work as I am wanting.

@jancurn
Copy link
Member

jancurn commented Jul 22, 2019

Oh yeah, you're right, we'll fix this ASAP

@jancurn
Copy link
Member

jancurn commented Jul 22, 2019

It's fixed in #425

@c0bra
Copy link
Contributor Author

c0bra commented Jul 24, 2019

👍 thanks!

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 a pull request may close this issue.

2 participants