: 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
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?
More posts by @Eichhorn148
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.