todo.txt
来自「JGRoups源码」· 文本 代码 · 共 81 行
TXT
81 行
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 multipleports (as defined in mapping file) and forwards incoming connectionsto correct destinations.1. Destination (host:port) as part of message---------------------------------------------Currently the server takes incoming requests and routes them todestinations according to the specified mapping.However it should be possible to include the destination with anincoming request: when the proxy accepts a new connection it needs tocheck whether there is a destination directive. If not, it forwardsthe request according to the mapping table, otherwise it uses thedestination information shipped with the request to route themessage.If dynamic destination information is used, we will be able to listenon 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. Notethat the client side has to be instrumented to include dynamicforwarding 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 thanHTTP (80). To overcome this problem we create local server socketswhich accept requests and route them to port 80 on a remote servermachine. Each server socket is configured with a local port (on whichto listen) and a remote destination to which all requests should besent to. When receiving a request the forwarding destination isincluded with the message and sent to port 80 of the outsidemachine. The server proxy then forwards the request according to therouting destination included in the message.2.1. Example: mapping table client side---------------------------------------localhost:8110=pop.mail.yahoo.com:110 remote.host.com:80localhost:2200=cvs.sf.net:22 remote.host.com:80 (ssl)The first line creates a server socket on the localhost at port8110. Every incoming request will be forwarded to remote.host.com port80 and will include a forwarding destination ofpop.mail.yahoo.com:110. This means the proxy on the server sidewill receive a connection on port 80. It extracts the header, whichcontains the pop.mail.yahoo.com:110 destination and forwards therequest 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 toremote.host.com:80. However, if we have a firewall, and alloutgoing/incoming traffic is blocked, and we have to use SOCKS(5) toget outside, then this direct connection will fail. Therefore we needto enable SOCKS support in the Client Proxy by telling the VM aboutthe SOCKS server and port.Fortunately this does not require any code changes, but simply thesetting of some system properties. How to do is id described inhttp://java.sun.com/j2se/1.4/docs/guide/net/properties.html.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?