Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • How did you come up with that so fast? Are you a contributor to httpx and knew where to look right away? Commented Oct 3, 2022 at 13:42
  • No - I just used a debugger to dig into the responses object since I knew it would have to contain a reference to the socket, or the data wouldn't be readable via it :) Commented Oct 3, 2022 at 14:35
  • Here's an easier way (which also works when using Trio and will likely not "break" as easily): response.extensions['network_stream'].get_extra_info('server_addr') response.extensions['network_stream'].get_extra_info('client_addr') Commented Jan 8, 2024 at 16:22