scorpio17 has asked for the wisdom of the Perl Monks concerning the following question:
If I run this on SERVER_A, I can do the following (also on SERVER_A) and it works as expected:use strict; use HTTP::Proxy; my $proxy = HTTP::Proxy->new; $proxy->port( 8000 ); $proxy->init(); $proxy->agent->proxy([ [ 'http', 'https' ] => 'https://api.test.example.com/', ]); $proxy->agent->ssl_opts( verify_hostname => 0 ); $proxy->start;
But if I'm on another host (SERVER_B, for example) and I do this:curl http://localhost:8000/index
Then I get "Failed to connect : Connection refused"curl http://SERVER_A:8000/index
For what it's worth, the reason I'm trying to do this: host SERVER_B needs to access api.test.example.com, but isn't able to reach it directly. It can, however, reach SERVER_A, and SERVER_A can reach api.test.example.com, so I'd like to use SERVER_A to bridge the two.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Need help with HTTP::Proxy
by NetWallah (Canon) on Dec 30, 2021 at 22:29 UTC | |
by scorpio17 (Canon) on Dec 30, 2021 at 22:38 UTC | |
by scorpio17 (Canon) on Dec 30, 2021 at 22:57 UTC | |
by NetWallah (Canon) on Dec 31, 2021 at 04:20 UTC | |
by afoken (Chancellor) on Dec 31, 2021 at 10:41 UTC |