Add Unix socket listener support - #149
Conversation
|
Dumb question: what's the use case for listening on a Unix socket vs. a TCP/HTTP socket? |
I generally prefer to host internal services on Unix sockets.
|
|
Most OSs can restrict TCP sockets to a given user. That said, I am inclined to see this as a useful feature. Integrating it sensibly might take a bit of finessing. For example, |
|
I've updated the PR accordingly. |
|
Thanks. I agree with this: please squash and then I can merge. |
2fa7c8b to
074538b
Compare
|
Done. |
|
Thanks! |
|
Ah, that's an unrelated failure. I'll fix in a separate PR and then rerun this one. |
Allow
listento accept an absolute Unix-domain socket path in addition to an IPv4 or IPv6 socket address.This adds a shared listener/stream abstraction while preserving the existing HTTP request handling, authentication, and TCP behavior. It also documents the new configuration and adds an end-to-end Unix socket test.
Example:
Unix socket paths must not already exist when snare starts.
Tests:
cargo test --all-featurescargo clippy --bin snare --all-features -- -D warnings