I have a Mac Workstation, and I also have an EC2 instance (running Ubuntu Jammy) that we'll call my Proxy Box. I want my Mac Workstation to communicate out to the internet through my Proxy Box. Furthermore, I'm wanting to do this for ports that are not HTTP or HTTPS.
I currently have a proxy set up for HTTP and HTTPS and it works brilliantly! On my Mac Workstation I have the ssh tunnel set up like so :
.ssh/my_key.pem -L 80:localhost:80 -L 443:localhost:443 myaccount@proxybox.com
I enabled the proxy by going in to Network Preferences -> Proxies and turning on Web Proxy and Secure Web Proxy and pointing them both to localhost. On my Proxy Box, I have Tinyproxy running.
As I mentioned, this works amazingly well for HTTP and HTTPS traffic. Now I want to do the same thing for other ports! For example, let's talk about port 5432. I want to connect from my Mac Workstation to a postgres instance that's running in RDS. In other words, the postgres instance is not running on my Proxy Box. How do I set up this proxy?
If the answer is "use SOCKS5", I'm going to need a little more help. I tried to set up SOCKS5 on my Mac Workstation and it didn't really work. Chrome ignored it. Also, all the articles I've read just tell you about how to set up the SOCKS5 on the Mac Workstation. None of them tell me what I should be running on my Proxy Box, or how to get it set up. It is very frustrating! Also, I'm not even sure if SOCKS5 is the right way to go here. Needless to say, I need to do everything securely, preferably over SSH so I don't have to open any more ports on my Proxy Box.
Thank you for giving this a look!