Skip to content
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

how to get the remote ip? #101

Open
jqiris opened this issue Oct 13, 2023 · 3 comments
Open

how to get the remote ip? #101

jqiris opened this issue Oct 13, 2023 · 3 comments
Labels
blocked enhancement New feature or request

Comments

@jqiris
Copy link

jqiris commented Oct 13, 2023

No description provided.

@Totodore
Copy link
Owner

Currently you can't but it is on my to-do list. This issue can serve as a tracking issue for this feature

@Totodore Totodore added enhancement New feature or request help wanted Extra attention is needed labels Oct 13, 2023
@DnaBoss
Copy link

DnaBoss commented Nov 23, 2023

Currently you can't but it is on my to-do list. This issue can serve as a tracking issue for this feature
Hi,

I'm interested in working on this issue.
Do you have any specific suggestions or preferred approaches for tackling it?

Thanks!

@Totodore
Copy link
Owner

Hi!

The main issue is that there is no standardized way to manage the remote IP between http frameworks.

For example, Axum is storing connect information in extensions whereas salvo is storing them in its own Request type.

Therefore socketioxide can't manage remote IP in a standardized way.

What could be done is documenting this case and doing examples for each framework.

My main idea was to put a framework-specific middleware in front of the /socket.io path to store the client ip into the http extensions and then extract it with req_parts.
However this wouldn't work with connections initialized with the ws transport (see the req_parts doc for more info) so another way could be to add it to the headers map.

To summarize, currently, this issue is quite stuck. The only thing to do would be to do framework-specific example and document cases.

If you want to contribute you can also take a look at the other issues :).

@Totodore Totodore added blocked and removed help wanted Extra attention is needed labels Nov 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants