Mobile app version of vmapp.org
Login or Join
Eichhorn148

: Implement HTTP Connect with a web server rendering a single static page so that proxy PAC files can point to it I want to set up a fake proxy server that returns a fixed HTML page directly

@Eichhorn148

Posted in: #Proxy

I want to set up a fake proxy server that returns a fixed HTML page directly (same page for all requests) rather than actually proxying.

Use case: Users need to update the PAC file URL in their web browsers, so I want to show a message to users using the old PAC URL.

I can't find a way to do this using the Apache proxy modules or a CGI script. Example of trying to do this with a CGI script:

oldpacfile.pac:

function FindProxyForURL ( url, host ) {
return "PROXY 33.44.55.66:80";
}


pac-warning.conf:

<VirtualHost 33.44.55.66:80>
ScriptAlias / /data/www/pac-warning/cgi-bin/nph-warn/
</VirtualHost>


nph-warn:

#!/usr/bin/perl -T
print "$ENV{SERVER_PROTOCOL} 200 OKn";
print "Content-type: text/htmlnn";
print "<html>...HTML page here...</html>n";


This CGI script is incorrect, as it is being called for an HTTP "CONNECT" method but is responding as if this is a normal web request. How can I fake the CONNECT method and return an immediate HTML response?

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Eichhorn148

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme