Skip to content

Instantly share code, notes, and snippets.

@lene
Last active October 7, 2023 07:52
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save lene/a517e635de86e73f6a981b0b584fb68a to your computer and use it in GitHub Desktop.
Save lene/a517e635de86e73f6a981b0b584fb68a to your computer and use it in GitHub Desktop.
Using tor as SOCKS proxy with SOCAT
socat TCP-LISTEN:<localport> SOCKS4A:localhost:<host>:<remoteport>,socksport=9050
# for example, to ssh into secret.shell.server.org via tor, do:
$ socat TCP-LISTEN:22222 SOCKS4A:localhost:secret.shell.server.org:22,socksport=9050 &
$ ssh localhost -p 22222
@xanoni
Copy link

xanoni commented Sep 6, 2021

why SOCKS 4?

@lene
Copy link
Author

lene commented Sep 6, 2021

tbh I don't remember. Give SOCKS5 a try, and if it works, great!

@xanoni
Copy link

xanoni commented Sep 6, 2021

https://github.com/runsisi/socat

"socat with socks5 support (official socat release does not support socks5 proxy)"

Alright.

@dimaqq
Copy link

dimaqq commented Oct 28, 2022

master branch supports it, but there's no release. build from source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment