-
Notifications
You must be signed in to change notification settings - Fork 150
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
Enable socks proxy server specification #155
Conversation
Enable socks proxy server specification
Thanks @maxdidato ! |
how do I define user and password socks5 proxy credentials? I am using PIA proxy but couldn't find how to connect this, already looking a solution for some days, but still stucked. |
looking at the code it appears that socks connection block is only using host and port, while http proxy uses the 4 ( plus username and password) Please help me I'm really confused on how to settup this socks proxy with credentials.. thanks |
@acegilz The pull request let the user set a socks server without authentication. |
I see 😕 |
I'll take a look at this tonight, I may be able to come up with a PR because I poked around a bit at this area whilst investigating mikecmpbll/betfair#6. |
Thank you so much @mikecmpbll |
the code for socksify is really quite bizarre. anyways, i don't have an authenticated socks proxy which i can test against, but looking at the code you should be able to set the credentials like this: require 'socksify/http'
uri = URI.parse('http://www.google.com/')
socks_ip = '127.0.0.1' # your socks IP
socks_port = 9050 # your socks port
TCPSocket.socks_username = "username" # socks username
TCPSocket.socks_password = "password" # socks password
Net::HTTP.SOCKSProxy(socks_ip, socks_port).start(uri.host, uri.port) do |http|
http.get(uri.path)
end would you be able to test this @acegilz to see if you can get a page via your socks5 proxy? there's also a PR in the works on socksify, astro/socksify-ruby#24, to improve the interface when passing through credentials, which is going to be merged this weekend i understand. if this works for you, you can actually set the socks_username and socks_password on TCPSocket outside of httpi so you can get up and running immediately. i'll probably wait for the socksify interface to be tidied up before creating a PR here. |
|
@mikecmpbll Thanks |
This will let a user to specify a socks proxy server in order to perform a request via it