Curl through an intermediate server
Asked Answered
Q

2

6

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.

Quoits answered 27/9, 2018 at 18:51 Comment(3)
You might get a better response of serverfault or devops. This isn't really a programming question unless there are additional details.Theadora
Are you using command line interface ? or scripts?Crumpton
Scripts. So this should provide an unattended way of tunnelling.Quoits
L
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.

Lox answered 8/10, 2018 at 13:6 Comment(0)
J
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.

Jerri answered 9/10, 2018 at 18:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.