PackageDescription: HttpServerStreams

Http Server Streams

Last published: March 12, 2007 by 'michael'

Defines 8 Classes
Extends 8 Classes

This package implements a Streaming HTTP/1.1 Server.

Each server can have multiple handlers just in case you want to listen on port 80 and also for HTTPS port 443.
To start a server call:

(HttpServerStreams.Server at: 'http://localhost:8080' asIRI)
responseBlock: [:request |
request response
contentType: 'text/plain';
bodyBlock: [:stream | stream asStringStream nextPutAll: 'G''day mate!']];

Now visit http://localhost:8080 in your web browser.

Don't forget to inspect it and send it #stop to shut it down, otherwise it'll hold on to the port 8080. This server lets you stream information in and out, allowing you to send gigabytes of multimedia without stressing the VisualWorks engine or denying other users access to your server.