nixcloud/ip2unix

ip2unix socket unlinks immediately after creation

leifwalsh opened this issue · 1 comments

I'm trying to use ip2unix to make JetBrains Projector listen on a unix socket instead of an ip socket, as described in https://youtrack.jetbrains.com/issue/PRJ-278. I can put Projector behind an Envoy reverse proxy to terminate SSL and authentication/authorization, but I'm concerned that Projector will still be listening on the loopback address, which means on shared hosts, other users can connect to Projector directly without going through Envoy.

I tried wrapping Projector in ip2unix -r tcp,address=::ffff:127.0.0.1,port=8887,path=/tmp/projector.sock, but it appears that the process creates the socket file but then immediately unlinks it. I think maybe this has something to do with #16, possibly the JVM is binding the socket and then passing it to a child, or creating a child (I guess a thread) that then causes it to close.

As described in #16 (comment), I tried commenting out this line to prevent unlink altogether:

this->unlink_sockpath = newpath;

If I do that, it doesn't get unlinked, but then inbound connections hang forever instead of just failing to connect.

I'm not sure what to do to get more information here.

If I do that, it doesn't get unlinked, but then inbound connections hang forever instead of just failing to connect.

Can you please supply a run of ip2unix -vvvvv with that modification?

Additionally, can you provide a way to reproduce this in an automated test, eg. like this? I usually try to test with the affected software directly but I don't know anything about Projector.