-1

My remote server have access to specific third party API. But my local PC doesn't. I can do third party http request from server nodejs backend:

await axios.post("http://111.111.111.111:8810")

How can i setup SSH connection with tunneling for doing the similar request from my local PC?

1 Answer 1

0

SOCKS is the usual and most flexible method – your SSH client can pretend to be a SOCKS proxy, and Axios appears to support using a SOCKS proxy with help of a separate module.

Enable the "SOCKS proxy" by adding a "Dynamic" tunnel within PuTTY's SSH>Tunnel settings. (Alternatively, for both ssh.exe and plink.exe, use the -D option.) Test it out with curl -x first – some SSH servers might be configured to disable tunnels.

Here's a random article I found about configuring Axios – while it talks about Tor, everything applies to any other kind of SOCKS server:

import { SocksProxyAgent } from "socks-proxy-agent";

const agent = new SocksProxyAgent("socks://127.0.0.1:9050");

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .