# ./apps/comm/webserver.xotcl

## Package/File Information

No package provided/required
Defined Objects/Classes:

- SpecializedWorker: respond.
- h1:
- h2:

Filename: ./apps/comm/webserver.xotcl

Description: | This small demo program starts two different webservers:

- Firstly, it provides a sample web server that povides the documents in ../../src/doc (or the files specified with -root) at port 8086 (or at the port specified via the -port option) as unprotected resources.

- Secondly, it starts a second webserver with basic access control (it accepts test/test as user/password) on port 9096 (or on the port specified via -protected-port). If it receives a request for an resource named "exit", it terminates. For all other requests it returns actual information about the user and the issued request.

To see, how it works, contact it e.g. from netscape.

## Class: SpecializedWorker

Class: Class
Procs/Instprocs: respond.

Description: | Specialized worker that can be passed to any webserver

### Instprocs

- respond

  Description: | This method handles all responses from the webserver to the client. We implement here "exit", and we return the information about the actual request and user in HTML format for all other requests. This method is an example, how to access on the server side request specific information.

## Object: h1

Class: Httpd

Description: | unprotected web server

## Object: h2

Class: Httpd

Description: | Web server with basic authentication using the specialized worker

Back to index page.