Skip to content

Instantly share code, notes, and snippets.

@Schm1tz1
Last active June 21, 2023 09:07
Show Gist options
  • Save Schm1tz1/2c7bb940c9c0506f9129b8e17a57253d to your computer and use it in GitHub Desktop.
Save Schm1tz1/2c7bb940c9c0506f9129b8e17a57253d to your computer and use it in GitHub Desktop.
Postman / Insomnia with Proxy based on SSH-tunnel

Postman / Insomnia with Proxy based on SSH-tunnel

In general, ssh is a powerful tool when it comes to tunneling and (reverse) proxying. All proxy functionalities offered by dynamic port formwarding with -D (or the reverse -R) are limited to SOCKS proxies.

Postman

Postman only supports HTTP proxies. One way to solve this is using https://github.com/oyyd/http-proxy-to-socks.

  • Installation and example usage:
npm install -g http-proxy-to-socks

ssh -N -D 1080 tunnel-host
hpts -s 127.0.0.1:1080 -p 8080
  • Afterwards, configure Postman to use a HTTP(s) proxy in Settings / Proxy / Proxy Server

Insomnia

Insomnia can use SOCKS5 proxies out-of-the-box even though not well documented. Steps to use it:

  • Start tunnel - e.g. ssh -N -D 1080 tunnel-host
  • Configure Insomnia in Preferences / General / HTTP Network Proxy and add socks5 as a protocol, i.e. simply put socks5://localhost:1080 into the HTTP proxy field. That's it!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment