astro / socksify-ruby

Redirect any TCP connection initiated by a Ruby script through a SOCKS5 proxy
http://socksify.rubyforge.org/
Other
165 stars 79 forks source link

Authentication Socket syntax #26

Open acegilz opened 8 years ago

acegilz commented 8 years ago

I'm trying to connect to a socks5 proxy that requires credentials. I'm using socksify-ruby but can't stop receiving this error

SOCKSError::NotAllowed: connection not allowed by ruleset

From what I read it's an authentication issue but I am unable to find the right syntax.

Currently I'm trying this:

 proxy: 'socks://username:password@proxy-nl.privateinternetaccess.com:1080' 

I believe this is already supported however I would like if someone could tell me a request example Thanks in advance

MatzFan commented 2 years ago

I would like to add authentication support to socksify and the code is all ready to go, based on #33 & #24 (thanks to @ojab & @musybite). What a need is a test case. Can someone please point me at somewhere where I can test socks authentication, thanks.

kornate commented 1 year ago

Hi @MatzFan! You can easily set up a local SOCKS proxy with authentication on any Linux server using via SSH. I've tailored these instructions for Ubuntu:

  1. Make sure PasswordAuthentication yes is in your /etc/ssh/sshd_config using sudo nano, restart SSH with sudo systemctl restart ssh or sudo service ssh restart after making changes.

  2. On your local machine, create the SOCKS-over-SSH proxy locally with ssh -D 1080 -f -C -q -N -p 22 <vps_username>@<vps_ip>. When prompted for a password, use the VPS password.

This can also be done without using a VPS, if you run an ssh server on your local machine instead. It could be done with Github Actions I imagine too.

I hope this helps! Would love to see this merged as it's also blocking lostisland/faraday pull #992. Thank you for taking over this repo as maintainer!

MatzFan commented 1 year ago

Thanks @kornate, I'll look into doing this in Github actions and try and get a release out with authentication tested.