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 --socks-proxy parameter to use socks proxy #6353

Closed
wants to merge 22 commits into from

Conversation

Don42
Copy link

@Don42 Don42 commented Jul 24, 2015

resolves #402
This allows the user to specify a socks proxy to
tunnel the connection through.
This does add a soft dependency on socksipy. Normal operation will work without it,
but socks support obviously depends on it.

I did some positive tests and a videos were downloaded from youtube via the socks proxy.
I did not test other hosts, but assume it should work the same.
I am not certain what happens if --socks-proxy and --proxy are specified simultaneously. Did not have a http proxy to test this.
The unittests have not finished running yet, but since none of my code (except adding the option) is actually run if the --socks-proxy option is not set it seems highly unlikely for it break existing functionality.

@Don42 Don42 mentioned this pull request Jul 24, 2015
@yan12125
Copy link
Collaborator

This approach forces all network traffic going through the SOCKS proxy. The urllib2 handler approach might be better.

@Don42
Copy link
Author

Don42 commented Jul 25, 2015

Why is it a bad thing if all traffic goes through the proxy? Which traffic do you want bypassing the proxy?

@yan12125
Copy link
Collaborator

For some Chinese sites (letv, sohu and youku), it's possible to use different proxies for different requests. In such cases your solution introduce traffic waste.

@Don42
Copy link
Author

Don42 commented Jul 25, 2015

I think I nearly got it. Will update this PR tomorrow.

@dstftw
Copy link
Collaborator

dstftw commented Jul 25, 2015

As already mentioned in IRC conversation you should ensure there are no problems bundling SocksiPy with py2exe in the first place.

dstftw and others added 7 commits July 25, 2015 22:19
That's how YouTube reports them in their DASH manifest.
This allows the user to specify a socks proxy to
tunnel the connection through. This feature requires that
PySocks is available. If the user tries to use a SOCKS proxy
without PySocks available an error is printed and the process is
aborted.
This allows the user to specify a socks proxy to
tunnel the connection through. This feature requires that
PySocks is available. If the user tries to use a SOCKS proxy
without PySocks available an error is printed and the process is
aborted.
@Don42
Copy link
Author

Don42 commented Jul 26, 2015

Sorry about all the commits. I'm going to close this one and create a new clean PR.

@Don42 Don42 closed this Jul 26, 2015
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.

SOCKS proxy support
6 participants