I need to send PUT/GET/POST request with curl
through a custom port from client1 to server2. However, server2 only accepts these requests from server1, and denies client1 if connected directly. What would be the best way to tunnel curl requests from client1 to server2 through server1.
Asked
Active
Viewed 379 times
6

Arman
- 927
- 3
- 12
- 32
-
You might get a better response of serverfault or devops. This isn't really a programming question unless there are additional details. – Retired Ninja Oct 03 '18 at 12:44
-
Are you using command line interface ? or scripts? – Gratien Asimbahwe Oct 10 '18 at 10:54
-
Scripts. So this should provide an unattended way of tunnelling. – Arman Oct 17 '18 at 07:34
2 Answers
4
Configure a proxy (like squid) to listen on some port on server1. When client will send request to server1, the request will get forwarded to server2.

Deepak Garud
- 977
- 10
- 18
1
Assuming you have ssh access on server1, this can be easily done using :
ssh user@server1 curl server2/some/path
You can modify the curl command for PUT, POST accordingly.

Gautam
- 1,862
- 9
- 16