Specification
There is a problem with obtaining the ReverseConnection's NATified port during the NAT traversial process. If we can combine the two sockets that the ForwardProxy and the ReverseProxy uses we can greatly simplify the problem. The result being that if we receive a connection from a node, to establish a connection back we can use the same IP and Port` information.
The ReverseProxy and ForwardProxy needs to share a UTP socket. To this end we need to combine the ForwardProxy and ReverseProxy into a single Proxy class. any config parameters will need to be updated. duplicated logic between the two proxies will need to be combined together. anything specific to the forward or reverse case will need to remain separate. Things like openConnection will need to be differentiated by forwardOpenConnection reverseOpenConnection ect.
The old proxies will need to be removed and any tests using them will need to be updated to use the new Proxy class.
New naming of all ports and hosts:
┌────────────┐ clientHost forwardHost forwardHost clientHost┌────────────┐
│ │ clientPort forwardPort forwardPort clientPort│ │
│ GRPCClient ├────────────────┐ ┌──────────────┤ GRPCClient │
│ │ │ ┌───────┐ ┌───────┐ │ │ │
└────────────┘ └──────► │ │ ◄───────┘ └────────────┘
│ Proxy ◄─────────────► Proxy │
┌────────────┐ ┌──────┤ │ proxyHost │ ├───────┐ ┌────────────┐
│ │ │ └───────┘ proxyPort └───────┘ │ │ │
│ GRPCServer ◄────────────────┘ └──────────────► GRPCServer │
│ │ serverHost reverseHost reverseHost serverHost│ │
└────────────┘ serverPort reversePort reversePort serverPort└────────────┘
Additional context
Tasks
Specification
There is a problem with obtaining the
ReverseConnection's NATified port during theNATtraversial process. If we can combine the two sockets that theForwardProxyand theReverseProxyuses we can greatly simplify the problem. The result being that if we receive a connection from a node, to establish a connection back we can use the sameIP andPort` information.The
ReverseProxyandForwardProxyneeds to share aUTPsocket. To this end we need to combine theForwardProxyandReverseProxyinto a singleProxyclass. any config parameters will need to be updated. duplicated logic between the two proxies will need to be combined together. anything specific to the forward or reverse case will need to remain separate. Things likeopenConnectionwill need to be differentiated byforwardOpenConnectionreverseOpenConnectionect.The old proxies will need to be removed and any tests using them will need to be updated to use the new
Proxyclass.New naming of all ports and hosts:
Additional context
NodeGraph#344 (comment)Tasks
ForwardProxyandReverseProxy.ForwardProxyandReverseProxyinto a singleProxyclass.ReverseProxyandForwardProxymodules.ProxymoduleProxymoduleProxy.test.ts