-
Notifications
You must be signed in to change notification settings - Fork 382
Make Incoming::remote_address either a TransportAddr or an IncomingAddr #3948
Description
Incoming::remote_address for a connection initiated via a relay will currently show the fake IPV6 address.
One of the main purposes of remote_address is to implement rate limiting, and for that it would be very useful to know if the connection was initiated directly or via a relay. Also, the user should not see our fake IPV6 addrs if we can avoid it.
So make Incoming::remote_address either a TransportAddr or a custom enum IncomingAddr. The reason for the latter would be that we do know the EndpointId if we translate the IPV6 address, and this would be information that would be useful for a filter.
A separate but related issue: there isn't a remote_address in Accepting. But Accepting is the first state that a per-ALPN protocol handler gets to see. So if we wanted to allow protocol handlers to perform filtering or rate limiting by SocketAddr, we would have to add this. Also, it would be more symmetrical to the iroh-quinn API.
Q: should we add a new fn and deprecate remote_address, or change the signature of remote_address?
Q: TransportAddr or custom enum that contains EndpointId?