Board index » delphi » Indy: TIdMappedPortTCP

Indy: TIdMappedPortTCP

Hi everyone,

i have changed from TIdTunnelMaster to TIdMappedPortTCP. I want to write a
proxy server for http (for our school) and i need some advice.

The documentation of this controls is very less. I want to code the proxy
for multiple different connections on one control:

example:
client 1 > www.test.com
client 2 > www.altavista.com
client 3 > www.nevrona.com
client 4 > www.borland.com

but the controls allows me only to set one address (masterport, masterhost).
How can i code it that it is working like i want.
bye
Andi

 

Re:Indy: TIdMappedPortTCP


[This followup was posted to borland.public.delphi.internet.winsock and
a copy was sent to the cited author.]

In article <3acb2952_1@dnews>, tgtRa...@usa.com says...

Quote
> Hi everyone,

> i have changed from TIdTunnelMaster to TIdMappedPortTCP. I want to write a
> proxy server for http (for our school) and i need some advice.

> The documentation of this controls is very less. I want to code the proxy
> for multiple different connections on one control:

> example:
> client 1 > www.test.com
> client 2 > www.altavista.com
> client 3 > www.nevrona.com
> client 4 > www.borland.com

> but the controls allows me only to set one address (masterport, masterhost).
> How can i code it that it is working like i want.

You are probably going to have to rethink this.  A good start is to use
a TIdHTTPServer to listen for client requests.  You than use the Headers
from the request to form a request with a TIdHTTP component (you run
that client in the context of the server thread).  You than make that
request and pass the results as a reply to your HTTPServer request.

The way a HTTP Proxy works is like this:

   [my schools client]
    |   (makes proxy        + (proxy sends HTTP reply
    |    request)           |  to the original client)
    +                       |
   [Proxy server]    
   |  (sends HTTP request   + (Sends HTTP to your server    
   |  (to webiste)          | (as if it were the client)
   +                        |
   [http://www.nevrona.com]

Since you are planning to do a HTTP Proxy, I urge you to consult the
appropriate RFC (I beleive we mention it our documentation) particularly
because there are some finer technical points that you have to deal with
depending on your application such as "Cache" expirity, No-Caching
replies from the website, and proxy authentication for the schools
client (if necessary).

I know there is some interest in this area.

HTH.
--
Support the anti-Spam amendment - Join at http://www.cauce.org/
J. Peter Mugaas     E-Mail:  oma00...@mail.wvnet.edu
http://wvnvm.wvnet.edu/~oma00215/  ICQ Number:  14297043
Finger for PGP Key

Re:Indy: TIdMappedPortTCP


take a look at this:

http://www.sitecreations.nl/delphi/IdHTTPProxy.pas

HTH

Bas Gooijen

Quote
"Andreas Schwarz" <tgtRa...@usa.com> wrote in message

news:3acb2952_1@dnews...
Quote
> Hi everyone,

> i have changed from TIdTunnelMaster to TIdMappedPortTCP. I want to write a
> proxy server for http (for our school) and i need some advice.

> The documentation of this controls is very less. I want to code the proxy
> for multiple different connections on one control:

> example:
> client 1 > www.test.com
> client 2 > www.altavista.com
> client 3 > www.nevrona.com
> client 4 > www.borland.com

> but the controls allows me only to set one address (masterport,
masterhost).
> How can i code it that it is working like i want.
> bye
> Andi

Other Threads