Skip to content

Support for Unix sockets in tor_rtcompat

Janosch Gräf requested to merge sw1tch/arti:sw1tch/unix-sock into main

This implements support for AF_UNIX sockets in tor_rtcompat.

I don't think it's possible to remove the whole UnixProvider if Unix sockets are not available, so I chose to return ErrorKind::Unsupported if the OS doesn't support Unix sockets. If someone has a better idea on how to handle this, please let me know.

Tokio has support for named pipes on Windows, so we could in the future implement "Unix" sockets on Windows. async-std doesn't seem to support named pipes. I couldn't find anything on how this is handled in C-Tor.

I ran cargo check and clippy with Linux and Windows as target and with the async-std feature to make sure the conditional compilation works.

Merge request reports