Project

General

Profile

Feature #2806

Record the IP address of the website

Added by Luke Murphey almost 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
07/03/2020
Due date:
% Done:

100%

History

#1 Updated by Luke Murphey almost 4 years ago

Obs:
# This works
from website_monitoring_app import requests
rsp = requests.get('http://google.com', stream=True)
rsp.raw._fp.fp._sock.getpeername()

# This does not
session = requests.Session()
http = session.get('http://google.com')
http.raw._fp.fp._sock.getpeername()
Qs:
  • Does this work as a context manager?
    • from website_monitoring_app import requests
      with requests.Session() as s:
          http = s.get('http://google.com')
          http.raw._fp.fp._sock.getpeername()
      
    • No
  • Does monkey patching httplib work?
    • No
Refs:

#2 Updated by Luke Murphey almost 4 years ago

Summary:

I cannot do this without dropping the use of request sessions. The session allow connection pooling with improves performance and allows me to set maximum redirects to follow.

#3 Updated by Luke Murphey almost 4 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF