
                              Todo List
                              =========

$Id: todo.txt,v 1.1.1.1 2003/09/09 01:24:12 belaban Exp $


Currently Proxy resides on the server system, listens on multiple
ports (as defined in mapping file) and forwards incoming connections
to correct destinations.


1. Destination (host:port) as part of message
---------------------------------------------

Currently the server takes incoming requests and routes them to
destinations according to the specified mapping.
However it should be possible to include the destination with an
incoming request: when the proxy accepts a new connection it needs to
check whether there is a destination directive. If not, it forwards
the request according to the mapping table, otherwise it uses the
destination information shipped with the request to route the
message.

If dynamic destination information is used, we will be able to listen
on a single server socket only; all clients send their request
(including the destination it should be forwarded to) to the server,
and the server then handles the request in a separate thread. Note
that the client side has to be instrumented to include dynamic
forwarding information with each request (see Client Proxy).


2. Client Proxy
---------------

When a client is behind a firewall, it is often not possible to create
(TCP) connections to hosts outside the firewall on ports other than
HTTP (80). To overcome this problem we create local server sockets
which accept requests and route them to port 80 on a remote server
machine. Each server socket is configured with a local port (on which
to listen) and a remote destination to which all requests should be
sent to. When receiving a request the forwarding destination is
included with the message and sent to port 80 of the outside
machine. The server proxy then forwards the request according to the
routing destination included in the message.




2.1. Example: mapping table client side
---------------------------------------

localhost:8110=pop.mail.yahoo.com:110 remote.host.com:80
localhost:2200=cvs.sf.net:22          remote.host.com:80 (ssl)

The first line creates a server socket on the localhost at port
8110. Every incoming request will be forwarded to remote.host.com port
80 and will include a forwarding destination of
pop.mail.yahoo.com:110. This means the proxy on the server side
will receive a connection on port 80. It extracts the header, which
contains the pop.mail.yahoo.com:110 destination and forwards the
request to Yahoo. The response is then returned via the regular way.

2.1.1 SOCKS support
-------------------

In the above example we established a direct TCP connection to
remote.host.com:80. However, if we have a firewall, and all
outgoing/incoming traffic is blocked, and we have to use SOCKS(5) to
get outside, then this direct connection will fail. Therefore we need
to enable SOCKS support in the Client Proxy by telling the VM about
the SOCKS server and port.

Fortunately this does not require any code changes, but simply the
setting of some system properties. How to do is id described in
http://java.sun.com/j2se/1.4/docs/guide/net/properties.html.




