pgaref / HTTP_Request_Randomizer

Proxying Python Requests
http://pgaref.com/blog/python-proxy/
MIT License
151 stars 59 forks source link

Error whilst checking proxy breaks connection with RST #6

Closed ieguiguren closed 8 years ago

ieguiguren commented 8 years ago

`Next proxy: http://41.231.120.118:8888 Traceback (most recent call last): File "requestProxy.py", line 192, in request = req_proxy.generate_proxied_request(test_url) File "requestProxy.py", line 169, in generate_proxied_request headers=req_headers, timeout=req_timeout) File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 69, in get return request('get', url, params=params, _kwargs) File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 50, in request response = session.request(method=method, url=url, _kwargs) File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 465, in request resp = self.send(prep, **send_kwargs) File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 605, in send r.content File "/usr/local/lib/python2.7/dist-packages/requests/models.py", line 750, in content self._content = bytes().join(self.iter_content(CONTENT_CHUNK_SIZE)) or bytes() File "/usr/local/lib/python2.7/dist-packages/requests/models.py", line 673, in generate for chunk in self.raw.stream(chunk_size, decode_content=True): File "/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/response.py", line 307, in stream data = self.read(amt=amt, decode_content=decode_content) File "/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/response.py", line 243, in read data = self._fp.read(amt) File "/usr/lib/python2.7/httplib.py", line 573, in read s = self.fp.read(amt) File "/usr/lib/python2.7/socket.py", line 380, in read data = self._sock.recv(left) socket.error: [Errno 104] Connection reset by peer

proxy_reset.zip `

pgaref commented 8 years ago

Looks like the exception was caused by the specific server, shutting down the connection abruptly. I would not expect this error to happen often/again - is that correct?

ieguiguren commented 8 years ago

I could reproduce this behaviour five times before I print the proxy URL and took capture so I don't know if every time it was this specific server. Anyway, if it happens to be just this server, it may happen again and we should manage this exception. On Jul 13, 2016 7:55 AM, "Panagiotis Garefalakis" notifications@github.com wrote:

Looks like the exception was caused by the specific server, shutting down the connection abruptly. I would not expect this error to happen often/again - is that correct?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pgaref/HTTP_Request_Randomizer/issues/6#issuecomment-232263414, or mute the thread https://github.com/notifications/unsubscribe/ABudQdeuK4NR04PbUIamTcq9aQ-nABivks5qVH3pgaJpZM4JLEn_ .