W3C home > Mailing lists > Public > uri@w3.org > October 2008

How to encode URL for HTTP over unix domain sockets?

From: Claes H <claesatwork@gmail.com>
Date: Thu, 9 Oct 2008 21:47:10 +0200
Message-ID: <495c267b0810091247q4a85a4bm91d6fd15f2807cb2@mail.gmail.com>
To: uri@w3.org

Hello,

What would be a good way to encode URLs for communication using HTTP
over Unix domain sockets? For example to implement a service locally:
Rather than serving it from http://www.example.com/service, to do it
from a socket on the file system named /tmp/daemon.socket

>From my understanding of RFC 3986, the file system path must somehow
be encoded as the 'host' part of the authority, in a way that can not
be confused with domain name addresses or IP addresses. So lets say we
would put a character from sub-delims in front, such as '!', to make
it invalid as any current HTTP URL. Then we get !/tmp/daemon.socket.
Next we percent-encode it and add the scheme and path parts. Then we
get

http://!%2Ftmp%2Fdaemon.socket/service

Playing a little bit with sub-delims, here are some variants:

http://filesystem,%2Ftmp%2Fdaemon.socket/service

http://socket;%2Ftmp%2Fdaemon.socket/service


Have I interpreted the specs correctly? Of course, this is not
compliant with HTTP as defined by RFC2616, but I am curious about
valid ways to extend this.

Background: I have for a while wondered why HTTP is rarely used for
local RPC, since it is has been so successful on the Internet. Using
it over TCP on localhost is certainly possible, but it can be argued
that it has security and performance issues, so other options are
chosen. Anyways, I googled on this, did not find much but at least a
discussion on the libcurl mailing list. See
http://daniel.haxx.se/blog/2008/04/14/http-over-unix-domain-sockets/

Thanks, Claes

-- 
C l a e s    H o l m e r s o n
Received on Friday, 10 October 2008 20:29:41 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:25:12 UTC