-
Notifications
You must be signed in to change notification settings - Fork 5
Description
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
- Reference Testnet Deployment #326 (comment)
- Reference Seed node not adding details of connecting node to its
NodeGraph
#344 (comment)
Tasks
- 1. prototype using a single UTP socket shared between the
ForwardProxy
andReverseProxy
. - 2. combine
ForwardProxy
andReverseProxy
into a singleProxy
class. - 3. update config types and config defaults to reflect egress and ingress being the same now.
- 4. remove old
ReverseProxy
andForwardProxy
modules. - 5. update any code that uses the old proxies to use the new
Proxy
module - 6. update any tests to use the new
Proxy
module - 7. combine fwd/rev proxy tests into
Proxy.test.ts
- 8. update host/port names.