@DTS Engineer
We have a separate module responsible for making decisions—whether to block, send directly, or route through a proxy. This module runs in a different process, and the extension communicates with it via IPC.
When the extension receives a flow:
The extension accepts the flow and queries the decision module for a verdict (block, direct, or proxy). It sends all metadata except the source port(This is not available).
The decision module responds with the verdict and, in the case of a proxy decision, the listener details (loopback IP and port). It also stores the metadata for later use when forwarding the flow to the proxy.
If the verdict is "send direct," the extension copies the flow to its actual destination.
If the verdict is "send to proxy," the extension copies the flow to the decision module’s listener.
Just before sending the flow to the proxy listener, the extension also provides the source port so that the decision module can update the corresponding metadata using the flow ID.
When the proxy listener receives the copied flow, it looks up the metadata using the source port, which serves as the only unique identifier at that point.
If we could obtain the source port right away and only talk to the decision module once, the whole process would be much simpler.