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

Adds unix socket support

Open NULLx76 opened this issue 3 months ago • 4 comments

Adds support for running the api server on a unix socket, it will do this if no port is specified in the config.

image

Fixes issue #49

NULLx76 avatar Sep 26 '25 11:09 NULLx76

Hi, thanks for your PR!

I am not convinced that just not specifying a port is a good way to indicate a unix socket. Rather, I think this will lead to confused people that don't understand why the server doesn't work and why there is a file called 0.0.0.0 in their current folder.

msrd0 avatar Sep 26 '25 16:09 msrd0

That is indeed a good point, how would you like the config to look?

NULLx76 avatar Sep 26 '25 17:09 NULLx76

Ideally, it allows to either set port and listen or unix_socket. But this is work.

Less ideally, we keep port optional with some default value like 8080, and add a boolean flag called something like unix that makes port ignored (maybe even an error if set) and uses the string passed to listen.

Or we eliminate the port thing all2gether and change listen to the format ip:port or unix domain socket.

@LuckyTurtleDev any thoughts?

msrd0 avatar Sep 26 '25 17:09 msrd0

not sure how to do this in the best way.

Ideally, it allows to either set port and listen or unix_socket

this would be my favor solution. But I am not sure if this is possible without losing #[serde(deny_unknown_fields)]

LuckyTurtleDev avatar Oct 21 '25 11:10 LuckyTurtleDev