spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / web / dev / proxy

The Applet Proxy Protocol

Developer News
OpenOffice 3.2 Lands Amid Critical Changes
Red Hat, IBM Firmly in KVM Virtualization Camp
Red Hat Talks Up Open Source Cloud Plans

We start by defining a simple protocol that will allow the client to talk to the server. In network programming, the protocol is the language the client and the server use to communicate over the network. Examples of protocols include SMTP (sending mail), POP3 (fetching mail) and HTTP (the Web protocol). Most of these protocols have a similar format: the client sends single-line text commands indicating what they want, and the server replies with a code indicating error or success, and then maybe additional data. In our proxy protocol, there are only two commands: PROXY and QUIT. PROXY takes one argument, a URL to fetch, and returns the length of the document followed by the full text. A client can ask for as many documents as it wants, and then ends the session by sending the QUIT command. One good way to test a new network server is to telnet to the port on which it is running (here I am telnetting from a Solaris machine, jupiter, to an NT box named venus that is running the proxy server). These text-based, human-readable protocols let you act as if you are the applet client and see what the server does. Here's a sample session with the proxy server:

    
    jupiter:kdowney: telnet venus 4005 Trying 172.16.20.5...
    Connected to venus. Escape character is '^]'.
    
    Applet HTTP Proxy Server 1.0, (C) WebConcepts, LLC, 1997
    PROXY http://www.webconcepts.com
    +OK URL fetched; data to follow
    Content-length: 1314
    
    ....more follows
    
    QUIT
    +OK logging out of proxy server Connection closed by
    foreign host. 

The server responds with one of two codes: +OK or +ERR, with the latter indicating a mistake (each is followed by a description of the error or what has been successfully done, such as +OK logging out of proxy server or +ERR unknown directive if you type something other than QUIT or PROXY.

Now that we know what we want our generic server to do, it's just a matter of writing it. The full source for the server is available for download; we'll look at the salient features.


Comments are welcome


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

webref The latest from WebReference.com Browse >
Search Engine Optimization: Selecting and Embedding Keywords · Are Google's Language Translation Web Services Ready for Prime Time? · Installing and Using Meeplace, the Business Review CMS
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
IBM DB2 10 for z/OS: Justifying the Upgrade · Living La Vida Colo: Choosing the Right Colocation Facility · FTC Concerns over Social Media Privacy Linger

Created: Oct. 30, 1997
Revised: Oct. 30, 1997

URL: http://webreference.com/dev/proxy/protocol.html