moby / vpnkit

A toolkit for embedding VPN capabilities in your application
Apache License 2.0
1.11k stars 190 forks source link

Add a mechanism to forward outgoing TCP via a Unix domain socket #590

Closed djs55 closed 2 years ago

djs55 commented 2 years ago

This is based on the existing "gateway forwards" mechanism which allowed traffic sent to the gateway to be forwarded.

A forwards.json can be dynamically updated with IP network matches and Unix domain socket / Windows named pipe paths. When a SYN arrives, a request is sent on the Unix domain socket, allowing the server to reject or accept the request. Assuming the connection is accepted, the handshake is completed and traffic flows.