cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: HTTP connection to unix socket

From: Michal Marek <mmarek_at_suse.cz>
Date: Mon, 14 Apr 2008 10:03:15 +0200

Daniel Stenberg wrote:
> On Fri, 11 Apr 2008, Dan Fandrich wrote:
>
>> A straightforward approach would be to URL encode the socket name and use
>> that as the host name, e.g. http://%2Ftmp%2Fserver/resource would use the
>> UNIX socket /tmp/server. This should be unambiguous as / is illegal in a
>> host name. It looks ugly though, and would force a %2F to be added to all
>> socket names even when it wouldn't otherwise be needed, e.g.
>> http://.%2Fserver/resource I haven't check to see if this would play well
>> with IDN and whether adding a .%2F is allowed on all platforms.
>
> I'm also curious if these servers do vhosting on the domain sockets as well,
> as then we need the "host name" for the sockets too for a proper Host:
> header!

(Yes, vhosting on a single unix socket saves you a lot of inodes! ;-))

Maybe

http://example.org[/path/to/socket]/blah/blah

which is illegal URL as well (I think)? Of course, there's no guarantee
that someone else will start using the same URL for a completely
different purpose...

Michal
Received on 2008-04-14