I want the below curl command to run from my machine, but via a remote proxy server.
curl "https://site.fake/ping"
However, I want this to always work via a remote proxy server.
I was tring to set this up with an ssh tunnel:
sudo ssh -i ~/.ssh/private_key_file -L 443:site.com:443 [email protected]
But this did not do the trick, running under osx.
Any suggestions?
To use a proxy with Curl, you must pass the required proxy address using the -x (or --proxy) command-line option and proxy credentials using the -U (or --proxy-user) command-line switch. Proxy credentials may also be passed in the proxy string and will be URL decoded by Curl.
You need an SSH client that can issue CONNECT requests through the company HTTP proxy. If you're on Windows, using Putty is fine as it has built-in support for tunneling through a HTTP proxy. If you're on unix/linux (or cywgin) you can use openssh with corkscrew to go through the proxy to your home computer's port 443.
curl supports SSH version 2 scp transfers. curl supports SFTP (draft 5) done over SSH version 2. curl supports SMB version 1 for upload and download. Uploading contents to an SMTP server means sending an email.
Try using a socks5
proxy for example:
$ ssh -D 8080 -f -C -q -N [email protected]
Then you could use curl
like this:
curl -x socks5h://0:8080 https://example.com
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With