NAME
PAGI::App::Proxy - HTTP reverse proxy (DEMO ONLY - NOT FOR PRODUCTION)
SYNOPSIS
use PAGI::App::Proxy;
my $app = PAGI::App::Proxy->new(
backend => 'http://localhost:8080',
)->to_app;
DESCRIPTION
Simple HTTP reverse proxy for development and demonstration purposes.
WARNING: NOT FOR PRODUCTION USE
This module has known security and performance issues:
SSRF Vulnerability - No validation of backend URLs. Attackers could potentially target internal services (localhost, private IPs).
Blocking I/O - Uses synchronous
IO::Socket::INET, which blocks the entire event loop during backend requests. This defeats the purpose of async and severely limits throughput.No Connection Pooling - Creates a new connection for every request.
Limited Error Handling - Basic 502 response on connection failure.
For production reverse proxy needs, consider:
A proper async HTTP client like Net::Async::HTTP with PAGI
Plack::App::Proxy if migrating from PSGI
This module is included as a simple demonstration of the PAGI interface for proxy-style applications.
OPTIONS
backend- Backend URL (default: 'http://localhost:8080')timeout- Connection timeout in seconds (default: 30)headers- Hashref of additional headers to add to requests