moby / vpnkit

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

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

Closed djs55 closed 1 year ago

djs55 commented 1 year 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.