Re: writing a proxy ..



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
.



Relevant Pages

  • Re: Trying to GET google with socket....problem
    ... I tried changing the HTTP to 1.1 but it still doesn't work. ... you must read and understand RFC 2616. ... Also putting the Host header or adding the full ...
    (comp.lang.ruby)
  • Re: Proxy authentication
    ... my proxy name, echoed from $http_proxy in firefox.sh is: ... I used it for http, https and ftp edit box of the said configuration ... Conexão recusada ... couldn't connect to host ...
    (alt.os.linux.suse)
  • Re: internet proxy
    ... Is it possible to create separate shortcuts to IE - one with 'proxy server ... This script gets used when you enable the "Automatically ... connect to the host so no proxy would get used. ...
    (microsoft.public.windowsxp.general)
  • Re: sygate and shields up
    ... Please first read RFC 792 and try to understand it. ... that a packet to this host cannot be routed (ICMP Destination ... you wanted to communicate with, you get a message: ... > your IP, and anything else your security settings allow, if it wants ...
    (comp.security.firewalls)
  • Re: cross posts
    ... Obsoletes RFC: 802 ... is a successor to the existing 1822 Host Access Protocol. ... physical port locations to address each other. ... o Section 2.6 describes the new "1822L name server" in the IMP, ...
    (sci.military.naval)