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 request IP address? #272

Closed
1 task
cawa-93 opened this issue Dec 12, 2022 · 2 comments
Closed
1 task

How to get request IP address? #272

cawa-93 opened this issue Dec 12, 2022 · 2 comments
Labels
question Further information is requested

Comments

@cawa-93
Copy link

cawa-93 commented Dec 12, 2022

Describe the feature

For our business logic, we need to receive information about the IP address of the requester. I did not find relevant information in your documentation

Additional information

  • Would you be willing to help implement this feature?
@NozomuIkuta
Copy link
Member

NozomuIkuta commented Dec 12, 2022

@cawa-93

IP address is handled at lower layer than h3.

You could find information by googling Node.js http.ClientRequest or its socket property (i.e. net.Socket class).
In terms of h3, you can access it via event.req.* property.

By the way, IP address that you need might be value of HTTP header, which depends on your infra architecture (e.g. using proxy server).

@NozomuIkuta NozomuIkuta added the question Further information is requested label Dec 12, 2022
@cawa-93 cawa-93 closed this as completed Dec 12, 2022
@cawa-93
Copy link
Author

cawa-93 commented Dec 12, 2022

Tiny note

In terms of h3, you can access it via event.req.* property.

event.req is deprecated at the moment. You should use event.node.req instead

@harlan-zw harlan-zw mentioned this issue Aug 10, 2023
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants