Integrate Tor
We could provide Tor as a handler for the TCP and UDP interfaces.
-
[ ] Compile Tor for WASI or for a custom redshirt target.
-
[ ] Tor and the network handler need to be able to coexist. Design a way for higher-level applications to use Tor, while Tor itself uses the network handler.
Tor and the network handler need to be able to coexist. Design a way for higher-level applications to use Tor, while Tor itself uses the network handler.
I can see two different ways to do that:
Possibility 1
The kernel allows multiple handlers for an interface (e.g. both Tor and the regular network handler for TCP/UDP), and makes it possible for some applications to use a certain handler and for other applications to use another.
Tor would at the same time register itself as a handler for TCP/UDP and also use the TCP/UDP interfaces.
With this option, we need to avoid loops where for example the network handler is a mock that accidentally sends its packets through Tor.
Possibility 2
The "Linux way".
Tor registers itself as a network interface and redirects its packets to the "actual" network interface. A privilege system forces applications to use the Tor network interface.