crab-hole icon indicating copy to clipboard operation
crab-hole copied to clipboard

add Unixlistener

Open LuckyTurtleDev opened this issue 1 month ago • 2 comments

replace: #51 fix: #49

Change config: move port and listen to a single new listener . If listener start with with the prefix unix://, the listener will be interpreted as unix listener.

LuckyTurtleDev avatar Nov 17 '25 10:11 LuckyTurtleDev

i am not sure if i want to delete random files at start. It would be probably be better to just delete the socket at the drop implementation.

LuckyTurtleDev avatar Nov 17 '25 10:11 LuckyTurtleDev

No, you should not delete the socket file if it exists. Some daemon orchestrators like systemd will actually create the socket themselves and expect you to use that socket. I believe they also have a mode where they listen on the socket, and if a request comes in, starts the service on demand. But I have never used that feature of systemd, so I wouldn't know for sure, but I believe I read that systemd sets an environment variable so you'd know to re-use that socket, but then again I am against systemd-specific solutions, so I think we should just re-use the existing socket whenever we can.

Also, it should be possible to set user/group/permissions on the unix socket file. Especially when the socket was not created by systemd, this comes in handy. But this can be done in a follow-up PR.

msrd0 avatar Nov 17 '25 11:11 msrd0