Live data from Hacker News

Show HN: ip2unix – Turn IP sockets into Unix domain sockets

github.com

21–24 of 24 posts

Re: Show HN: ip2unix – Turn IP sockets into Unix domain sockets

#21

So how do I access a unix socket in my browser? Be nice if "unix://file/path.html" worked.

You could map different ports to specific socket file names and use a dummy address, eg. like this:

ip2unix -r out,addr=127.1.1.1,path=foo-%p.sock firefox --new-instance

Whenever you then head over to something like http://127.1.1.1:9000/, the browser will try to connect to foo-9000.sock.

Re: Show HN: ip2unix – Turn IP sockets into Unix domain sockets

#23
post #3

This is very clever. Last time i ran benchmarks (several years ago), UNIX domain sockets were twice as fast as IP sockets so that's another reason to use them.

Isn't a TCP socket fastpathed on loopback ranges anyway?

There was a patch[1] a few years ago, but apparently it didn't make it into mainline. At least looking in net/ipv4/tcp.c I haven't found any traces related to that.

However, I could have sworn that I've seen a similar patch in recent years, but either my memories are serving me wrong or I simply can't find it anymore.

Nevertheless, I didn't benchmark whether this is the case, nor was performance the main goal for writing ip2unix. So if performance is a concern, maybe benchmark with your specific workload?

https://www.spinics.net/lists/netdev/msg210741.html

Re: Show HN: ip2unix – Turn IP sockets into Unix domain sockets

#24
post #23

Earlier quoted context omitted.

Isn't a TCP socket fastpathed on loopback ranges anyway?

There was a patch[1] a few years ago, but apparently it didn't make it into mainline. At least looking in net/ipv4/tcp.c I haven't found any traces related to that. However, I could have sworn that I've seen a similar patch in recent years, but either my memories are serving me wrong or I simply can't find it anymore. Nevertheless, I didn't benchmark whether this is the case, nor was performance the main goal for wri…

Interesting. Thanks
Post reply on HN