question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

feature request- capture ip address onto response object

See original GitHub issue

this is an extension of a request from the requests library (https://github.com/kennethreitz/requests/issues/2158)

I recently ran into an issue with the various “workarounds”, and have been unable to consistently access an open socket across platforms, environments, or even servers queried (the latter might be from unpredictable timeouts)

it would honestly be great if the remote ip address were cached onto the response object by this library.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:5
  • Comments:43 (20 by maintainers)

github_iconTop GitHub Comments

8reactions
misotrnkacommented, Jan 18, 2020

I would also like to +1 on this request. Knowing the IP address is essential for many use-cases. For example, rate-limiting requests per IP address. I don’t think any of the proposed work-arounds really work consitently.

2reactions
jvanascocommented, Jun 9, 2020

After quite some time experimenting with different methods, I’ve found a workaround that works consistently:

Elaborating off what @sigmavirus24 said - it’s not a workaround. You are creating a second request and obtaining DNS info from that. You may consistently get an ip address off that method, but there is no guarantee the ip address was associated with the first request. When dealing with domains that are fronted by CDNs or Load Balancers, there is a decreased chance the information will match up.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to get a client IP Address in Node.js (6 ways) - Abstract API
1. Retrieve User IP Address From the Request Object's Socket Property. First up, we find the request's IP address with a simple vanilla...
Read more >
How to get a user's client IP address in ASP.NET?
i have an application that checks a specific link clicks, and a specific user(by IP) cant click the link more than 5 times...
Read more >
255602 - Feature Request: Get IP address from devtools
Hi Chrome team, In our project, we use Webpagetest(www.webpagetest.org) which based on Chrome devtools to detect web page errors and latency ...
Read more >
X-Forwarded-For - HTTP - MDN Web Docs
The X-Forwarded-For (XFF) request header is a de-facto standard header for identifying the originating IP address of a client connecting to ...
Read more >
Accessing HTTP request and response objects - LoopBack
Return a value or promise for the response so that the framework can serialize it into HTTP responses. For example: import {get} from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found