cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: HTTP connection to unix socket

From: Nikolai Kondrashov <Nikolai.Kondrashov_at_oktetlabs.ru>
Date: Mon, 14 Apr 2008 12:59:13 +0400

Daniel Stenberg wrote:
> Thinking about it, we can even abuse the port number field if we just
> require the slashes to be encoded:
>
> http://example.org:%2fpath%2fto%2fsocket/blah/blah
>
> It just means that we'd treat a non-numeric port number as a unix domain
> socket path.
Why do you insist on abusing HTTP URL scheme? Why not introduce another one?
We could take file URL scheme:

file://<host>/<path>

And extend it:

unix://<host>/<socket path>?<URL-encoded tunnelled URL>

This way we could use it for any protocol tunnelled through a UNIX socket.
I.e. an HTTP URL accessible via UNIX socket could look like that:

unix:///var/local/http.socket?http%3A%2F%2Fcurl.haxx.se%2F%0A

(Note: host part is omitted, as it is done with file URLs)

It looks not that good, but it is safe and quite flexible.

Sincerely,
Nick
Received on 2008-04-14