Zinc HTTP Components

Historical Information

Warning: this page is mostly obsolete now, refer to the up to date documentation on the Zn homepage - May 2012

Zinc HTTP Components is an open-source Smalltalk framework to deal with the HTTP networking protocol. This is a new project (started September 1st 2010) that is currently under heavy development. Our long term goals are very ambitious: we want to reach the level of functionality, scope, architectural clarity and maturity of the Apache HTTP Components library. Our short term goal is to offer working HTTP client functionality to support fundamental features in a Smalltalk image. For the time being, Pharo is our reference platform.

Getting Started

In a separate document, Zinc HTTP Components - Getting Started you can find a high-level, code-oriented introduction, overview and tutorial describing the framework.

Installation

You have several options to install Zinc HTTP Components. To load the framework as an addon to your current image, execute the following script:

Gofer it
  squeaksource: 'ZincHTTPComponents';
  package: 'Zinc-HTTP';
  package: 'Zinc-Tests';
  load

If you also want to destructively replace all existing HTTP client functionality in your Smalltalk image, execute the following script:

Gofer it
  squeaksource: 'ZincHTTPComponents';
  package: 'Zinc-HTTP';
  package: 'Zinc-Tests';
  package: 'Zinc-Patch-HTTPSocket';
  load

Warning: loading of 'Zinc-Patch-HTTPSocket' is a bit harder to undo, you have to reload the package containing the class HTTPSocket, 'Network-Protocols' from its original source.

Compatibility with Pharo (1.1.1), 1.2.1, 1.3 and 1.4 should be 100%. Compatibility with Squeak 4.2 is not 100%, some cryptographic and encoding stuff is not working, without Announcements logging won't work, but overall the most used client and server features are functioning. A port to Gemstone is also available.

You can also use the Metacello configuration, ConfigurationOfZincHTTPComponents, like this:

Gofer it
  squeaksource: 'ZincHTTPComponents';
  package: 'ConfigurationOfZincHTTPComponents';
  load

Gofer it
  squeaksource: 'MetacelloRepository';
  package: 'ConfigurationOfZincHTTPComponents';
  load

ConfigurationOfZincHTTPComponents project latestVersion load.
ConfigurationOfZincHTTPComponents project latestVersion load: 'Tests'.

Live Demo

The web pages you are currently looking at are served by the Zinc HTTP Components standard web server, more specifically ZnMultiThreadServer with the ZnDefaultServerDelegate handler. The default / (slash) handler you would be seeing when you are running ZnServer locally (ZnServer startDefaultOn: 8080) is the /welcome page. This live demo setup is configured slightly differently to serve some HTML pages instead, under /zn by way of ZnStaticFileServerDelegate.

http://zn.stfx.eu is a cloud based virtual GNU/Linux server, more specifically an Amamzon AWS EC2 Micro Instance running Ubuntu 11.10 Server Edition using an Elastic IP address pointing to the http://stfx.eu - Smalltalk is the Red Pill website. Apache 2 was configured to statelessly load balance requests over 4 Smalltalk instances. Each Smalltalk instance is a Pharo 1.4 Smalltalk Image with Zinc HTTP Components run by a Pharo Cog VM. Monit is making sure that all 4 Smalltalk instances keep on running.

Status

Development

The source code for Zinc HTTP Components lives on SqueakSource at the following URL: http://www.squeaksource.com/ZincHTTPComponents.html where you will find some standard information to get you started.

We use an open development model. If you plan on making important changes that you would like to be integrated in the main development branch, it would be best if you discussed your plans with the authors. We like clean, elegant, self-documenting code. We like single purpose classes and small methods. We like tests, small commits and useful checkin messages.

Zinc HTTP Components is also one of the projects included in Lukas Renggli's Jenkins server. This server will continuously build the project on each commit to SqueakSource and will run all unit tests. Look for the project called 'Zinc'.

Recently, Zinc HTTP Components also became part of client builds of Pharo's Continous Integration Server, another Jenkins server with similar functionality.

Hosting of this website is provided by the stfx - Smalltalk is the Red Pill website. See also the information about the live demo.

Todo

Authors

License

Zinc HTTP Components is open-source software licensed under the MIT License. All contributions should be licensed under the same terms.

History

We didn't start from scratch: the initial code base started from Colin Curtin's HTTP Client library as described in the following SqueakMap entry: HC HTTP Client (local copy HC HTTP Client). A version of his code was in SqueakSource's PharoInbox project called HTTPClient-lr.30.mcz (local copy of the Monticello package: HTTPClient-lr.30.mcz). August 31 2010, Colin Curtin explicitely licensed this version under the MIT license and agreed to our intentions of working further on in with the option to integrate it into Pharo, after he already indicated this in an earlier email (local copy of the email conversation). Thank you, Colin, for writing this code so many years ago and for sharing it further!

On September 6th, Sven Van Caekenberghe started a new implementation of the Zinc HTTP Components framework. The goal is to have a clean and simple code base with tests that is easy to understand and to use. Just a couple of days later, Philippe Marschall contributed a first version of a working Seaside adaptor! A first replacement for the HTTPSocket facade became available September 14th. That day, Zinc HTTP Components became capable of taking care for itself: it managed to upload a version of the package Zinc-Patch-HTTPSocket using itself. The package patches (overwrites) class methods in HTTPSocket, redirecting them to ZnHTTPSocketFacade, effectively steering all HTTP client access in your Smalltalk image through Zinc HTTP Components. Since September 18th, there is also a simple static HTTP web server and a Moniticello server.

Since the beginning of 2011, Zn has been in production use at several sites. In April 2011, Paul DeBruicker succeeded in porting Zinc HTTP Components to Gemstone.

Ethymology

Any project needs a name. We also needed a namespace prefix for our Smalltalk classes. We choose 'Zinc' and 'Zn' respectively.

zinc |zi ng k|
noun
the chemical element of atomic number 30, a silvery-white metal 
that is a constituent of brass and is used for coating (galvanizing) 
iron and steel to protect against corrosion. (Symbol: Zn)
ORIGIN mid 17th cent.: from German Zink, of unknown origin.

Here is the Wikipedia entry: Zinc. Apart from the fact that this is a nice name, don't go searching for a hidden meaning: there is none.