Re: writing a proxy ..
- From: tom fredriksen <tom@xxxxxxxxxx>
- Date: Fri, 17 Feb 2006 01:27:55 +0100
ebby83@xxxxxxxxx wrote:
I redirect my browser to the local server and re-route the HTTP
request to the host.
I get a reply back from the HOST but unfortunately this is not shown in
my browser ( html appears in my console ) .
I am putting the code here .. ( Its a thread ) pls run with the Server
Class specified below it ..
Before asking a question you should really try to summarise the problem in a succinct code piece, not just attach all the code you have. Please see ESR's "Smart questions" (http://www.catb.org/~esr/faqs/smart-questions.html)
Secondly, I think you need to read the rfc for the http protocol (rfc 2068) and others (see http://www.networksorcery.com/enp/default0602.htm) for you to understand how a proxy works. As mentioned in another reply, doing readLine() is not the way to go. A reply can for example contain binary or MIME multi part data, so the processing is a bit more complex than just reading a line at a time You need to implement the proxy as a half part HTTP client and half part HTTP server to make it work properly and not run into mystical problems all along.
/tom
.
- Follow-Ups:
- Re: writing a proxy ..
- From: ebrahimbandookwala
- Re: writing a proxy ..
- References:
- writing a proxy ..
- From: ebby83
- writing a proxy ..
- Prev by Date: Re: Correct use of exceptions
- Next by Date: Re: how slow is exceptions really compared?
- Previous by thread: Re: writing a proxy ..
- Next by thread: Re: writing a proxy ..
- Index(es):
Relevant Pages
|