Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Http connection manipulationsby kazak (Beadle) |
on Jan 10, 2012 at 17:16 UTC ( [id://947198]=perlquestion: print w/replies, xml ) | Need Help?? |
kazak has asked for the wisdom of the Perl Monks concerning the following question:
Hi 2 all,and here is a problem. There is system (a perl proxy server + 10 parent-proxies) This proxy listens certain address\port and balances traffic between parents. From time to time some of upstream proxies are down. There are a bunch of scripts (black boxes that can't follow redirects) that must get their requested content.
Is there a possibility, in case of a certain response, replace a content that supposed to be returned. I mean for example if response is "404":
Detect this event (Done) Get initial URI (Done) Return this content through another proxy ( Almost done) Write returned content to a certain connection while it's open. I mean if client that supposed to receive 404 error, came from 111.111.111.111:15000, content requested by this client must be returned through another proxy-parent(roundrobin will take care about "return through another parent" part) and written to a 111.111.111.111:15000 socket. Is that possible, and if possible, then how? Thanks in advance to all monks.
Back to
Seekers of Perl Wisdom
|
|