-
Notifications
You must be signed in to change notification settings - Fork 291
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
added SOCKS[45] proxy support #380
base: master
Are you sure you want to change the base?
Conversation
socks_socket = SOCKS5Socket.new(proxy.host, proxy.port, options) | ||
end | ||
dest_site = Site.new(dest) | ||
opened_socket = socks_socket.open(dest_site.host, dest_site.port, {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
socks_socket
could potentially be nil
, probably need to raise above. Also var is defined within if condition, but that might be an acceptable style thing
e8486e1
to
26e9727
Compare
…add_socks_proxy_support
26e9727
to
9aeb8e7
Compare
@@ -1073,8 +1077,10 @@ def load_environment | |||
# HTTP_* is used for HTTP header information. Unlike open-uri, we | |||
# simply ignore http_proxy in CGI env and use cgi_http_proxy instead. | |||
self.proxy = getenv('cgi_http_proxy') | |||
else | |||
elsif ENV.key?('http_proxy') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would suggest changing this line to elsif getenv('http_proxy')
. As it now stands, setting "HTTP_PROXY" does not appear to work anymore, only works with "http_proxy"
Closes #177
added SOCKS[45] proxy support and its client impl, of course including tests with socks[45] server!
Usage is the following.