HTTP Extentions patches for Mozilla

Status

This code is in its initial stages. It is made available for those collaborating and any who wish to experiment. If you have questions or bug fixes, please contact [email protected]. Interoperability tests can be run against the MetaPack implementation in Apache.

Motivation

HTTP Extensions originally derived from PEP but was paired down to reduce implementation complexity. It provides a rigorous way to handle the traditionally chaotic realm of X- headers. It is a mechanism to identify and allocate additional headers and communicate which agents may or must understand them.

The growing world of dynamic protocol extension currently looks to XML protocols like SOAP. There are unfortunate protocol implications that can be handled by HTTP Extensions.

Code

The code is stored as a set of diffs against the mozilla CVS tree and a set of additional files.

Building

The code for apache, mozilla and the HTTP Extensions come from three different repositories. You will first need to login to each:

cvs -d :pserver:[email protected]:/home/cvspublic login # password is anonymous cvs -d :pserver:[email protected]:/cvsroot login # password is anonymous cvs -d :pserver:[email protected]:/sources/public login # password is anonymous

The easiest way to build is to pick someplace with a couple gig of free space (1798 Meg for mozilla, 67 Meg for apache, and 1 Meg for patches and added modules) and create a directory for this build, for instance, httpExt in the example below:

(mkdir httpExt && cd httpExt && make -f 2002/httpExt/apache_2/cvs.mk apache-DEBUG && make -f 2002/httpExt/mozilla_1/cvs.mk mozilla-DEBUG)

Now wait a looooong time. If you want to see it in action, try the demo:

(cd httpExt && make -f 2002/httpExt/Makefile demo)

Rebuilding

So now you've got a build but you want to tweak either the netwerk/protocol/http/src or netwerk/protocol/http/extensions.. It usually suffices to run make in that dir and rebuild the libnecko library in netwerk/build.

cd netwerk/protocol/http/src
make
cd ../extensions
make
cd ../../../build
make

Tests

Mozilla was tested against apache (with HTTP Extensions) and monitored with patchPanel.

Client:
GET http://localhost:9002/doc1.xhtml HTTP/1.1
Host: localhost:9002
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1b) Gecko/20020805
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*;q=0.1
Accept-Language: en-us, en;q=0.50
Accept-Encoding: gzip, deflate, compress;q=0.9
Accept-Charset: ISO-8859-1, utf-8;q=0.66, *;q=0.66
Keep-Alive: 300
Proxy-Connection: keep-alive
00-Action: GET-META(ACLs)
00-Accept: http://www.w3.org/1999/02/22-rdf-syntax-ns#
Opt: "http://www.w3.org/2001/07/07-MetaPackage/"; ns=00
Proxy Client:
GET /doc1.xhtml HTTP/1.1
Host: localhost:9002
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1b) Gecko/20020805
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*;q=0.1
Accept-Language: en-us, en;q=0.50
Accept-Encoding: gzip, deflate, compress;q=0.9
Accept-Charset: ISO-8859-1, utf-8;q=0.66, *;q=0.66
00-Action: GET-META(ACLs)
00-Accept: http://www.w3.org/1999/02/22-rdf-syntax-ns#
Opt: "http://www.w3.org/2001/07/07-MetaPackage/"; ns=00
Max-Forwards: 10
Via: 1.1 127.0.0.1:9003
Server:
HTTP/1.1 200 OK
Date: Mon, 05 Aug 2002 23:58:08 GMT
Server: Apache/2.0.40-dev (Unix)
Vary: 00-Accept,Opt
Last-Modified: Mon, 05 Aug 2002 08:32:14 GMT
ETag: "204185-102-c6d39f80"
Accept-Ranges: bytes
Content-Length: 1210
Content-Type: multipart/mixed; boundary=3a77fb6284b0b2ca6
00-Package-Language: http://www.w3.org/1999/02/22-rdf-syntax-ns#
00-Content-Type: application/xhtml+xml
00-Content-Length: 258
Man: "http://www.w3.org/2001/07/07-MetaPackage/"; ns=00

--3a77fb6284b0b2ca6
Content-type: text/xml
Content-length: 776

<?xml version="1.0"?>
<rdf:RDF
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
   <s:resourceAccessRule
    xmlns:s="http://www.w3.org/2001/02/acls/ns#">
      <s:accessor rdf:resource="http://www.w3.org/Systems/db/webId?all=all" />
      <s:access rdf:resource="http://www.w3.org/2001/02/acls/ns#racl" />
      <s:access rdf:resource="http://www.w3.org/2001/02/acls/ns#head" />
      <s:access rdf:resource="http://www.w3.org/2001/02/acls/ns#get" />
      <s:access rdf:resource="http://www.w3.org/2001/02/acls/ns#connect" />
      <s:access rdf:resource="http://www.w3.org/2001/02/acls/ns#options" />
      <s:access rdf:resource="http://www.w3.org/2001/02/acls/ns#trace" />
      <s:hasAccessTo rdf:resource="/doc1.xhtml" />
   </s:resourceAccessRule>
</rdf:RDF>

--3a77fb6284b0b2ca6
Content-type: application/xhtml+xml
Content-length: 258

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <title>doc1</title>
  </head>
  <body><p>content1</p></body>
</html>
--3a77fb6284b0b2ca6--
Proxy Server:
HTTP/1.1 200 OK
Date: Mon, 05 Aug 2002 23:58:08 GMT
Server: Apache/2.0.40-dev (Unix)
Vary: 00-Accept,Opt
Last-Modified: Mon, 05 Aug 2002 08:32:14 GMT
ETag: "204185-102-c6d39f80"
Accept-Ranges: bytes
Content-Type: multipart/mixed; boundary=3a77fb6284b0b2ca6
00-Package-Language: http://www.w3.org/1999/02/22-rdf-syntax-ns#
00-Content-Type: application/xhtml+xml
00-Content-Length: 258
Man: "http://www.w3.org/2001/07/07-MetaPackage/"; ns=00
Via: 1.1 127.0.0.1:9003
Content-Length: 1210

--3a77fb6284b0b2ca6
Content-type: text/xml
Content-length: 776

<?xml version="1.0"?>
<rdf:RDF
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
   <s:resourceAccessRule
    xmlns:s="http://www.w3.org/2001/02/acls/ns#">
      <s:accessor rdf:resource="http://www.w3.org/Systems/db/webId?all=all" />
      <s:access rdf:resource="http://www.w3.org/2001/02/acls/ns#racl" />
      <s:access rdf:resource="http://www.w3.org/2001/02/acls/ns#head" />
      <s:access rdf:resource="http://www.w3.org/2001/02/acls/ns#get" />
      <s:access rdf:resource="http://www.w3.org/2001/02/acls/ns#connect" />
      <s:access rdf:resource="http://www.w3.org/2001/02/acls/ns#options" />
      <s:access rdf:resource="http://www.w3.org/2001/02/acls/ns#trace" />
      <s:hasAccessTo rdf:resource="/doc1.xhtml" />
   </s:resourceAccessRule>
</rdf:RDF>

--3a77fb6284b0b2ca6
Content-type: application/xhtml+xml
Content-length: 258

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <title>doc1</title>
  </head>
  <body><p>content1</p></body>
</html>
--3a77fb6284b0b2ca6--

Valid XHTML 1.0!

Eric Prud'hommeaux

$Id: Overview.html,v 1.8 2002/08/06 01:47:41 eric Exp $