I want to build a service that passes all the traffic through the tor network. One way i thought of is to capture all the traffic coming out of a specific port, for example port 80/443 using windivert, add to the packet all the tor headers, and pass it to the first bridge.
What do you think about my way to solve this? do u have another one?
Such a tool already exists, see: Tallow (github).
To build such a tool requires quite a bit of engineering. Tallow works by redirecting TCP streams (using WinDivert) to a local Tor client which in turn connects to the Tor network, and is probably a good place to start if you want to build similar tools.