-
Notifications
You must be signed in to change notification settings - Fork 298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat:(conn): add RemoteAddr
and LocalAddr
method
#490
Conversation
kehiy
commented
Sep 15, 2024
•
edited
Loading
edited
- Fixes Remote address #489
@mafredri hi, can you kindly review this, please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except for the suggestion inline, the PR looks good. Thanks.
I would be interested in knowing what your use-case is though, how is this feature beneficial to you?
@mafredri about use case, several programs need to collect IP address sometimes to use it for spam protection and this kind of stuff. sometimes we have to be aware of who we are talking too. or use it in logs to check whats going on better. in my case we are developing a nostr relay which can be aimed for spam attacks a lot. |
@mafredri can you review again please? |
Since we're adding |
@mafredri so, based on your review, i found that we have a
which one makes sense in our case? |
i would include it in this pr. |
You can just do a similar check as done here: Lines 8 to 20 in 6c8e3ab
While you're at it, the linked code can be changed to just return We should also add these methods to the WASM implementation too, even if we can't return any useful information. |
@mafredri now both are added based on what you suggest. adding to wasm implementation is remained correct? should it be included in this pr? i need to look at wasm implementation to find out how can i do that. |
RemoteAddr
and LocalAddr
method