Feature #2806
Record the IP address of the website
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:
- The IP is included but not with a session object
- I think this doesn't work with connection pooling
- I could use something other than request.Session but I need to use this to set the max redirects
# 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
#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