# The Protocol Class

The Protocol class defines an application level protocol (HTTP, FTP, Gopher, etc.) to be used by libwww. Please note that access to the local file system also is considered to be an application level protocol treated identically to for example the HTTP protocol. The Protocol class does only know about the application layer protocol and it relies on the Transport Class to do the actual communication with the network, the local file system etc. The protocol class defines an access method for both a client and a server. A typical client application would probably only want to use the client method and a server only the server method. However, any application can use both which allows it to seamlessly to change between server and client profile as needed.

Libwww doesn't know anything about protocol modules. This has the big advantage that an application can register any number of protocols including access to the local file system. Libwww is independent of whether you make an application capable of speaking all known Internet protocols or only can access, for example a HTTP server - to the Library it's all a set of callback functions.

The Protocol object handles two types of callback functions: one for a client application and one for a server application. This means that you can register not only any type of protocol clients but also their server counterparts. Whether it is a client module or a server module, a protocol module is identified by an access scheme which is identical to the access scheme known from the URL syntax, for example

    	http://www.w3.org
    	ftp://ftp.w3.org
    	etc.

The User's Guide describes in detail how you can set up the protocol modules in your application.