CplusHua01 / proxpy

Automatically exported from code.google.com/p/proxpy
0 stars 0 forks source link

proxpy mixes up ports #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

These are (edited) screenscrapes. Adjust IP addresses and pathnamesto suit.

1. /NFS/projects/PROXY/test/proxpy.py

2. http_proxy=http://192.168.71.130:8080/   lynx http://192.168.7.179:8080/
3.

What is the expected output? What do you see instead?

I expect:

--------------------------------------------------------------------------------
lynx http://192.168.7.179:8080/

                                              Bulk Updates Progress Report

This page shows the status of Bulk Updates as at

        Thursday 17 May 2012 08:58:46 +1000 EST
...
...
--------------------------------------------------------------------------------
I get:

http_proxy=http://192.168.71.130:8080/   lynx http://192.168.7.179:8080/

Looking up 192.168.71.130:8080
Making HTTP connection to 192.168.71.130:8080
Sending HTTP request.
HTTP request sent; waiting for response.
Alert!: Unexpected network read error; connection aborted.
Can't Access `http://192.168.7.179:8080/'
Alert!: Unable to access document.

lynx: Can't access startfile 

--------------------------------------------------------------------------------

What version of the product are you using? On what operating system?

I think it's r27. I downloaded it yesterday.

Linux fed 3.3.0-4.fc16.i686 #1 SMP Tue Mar 20 18:45:14 UTC 2012 i686 i686 i386 
GNU/Linux
Fedora release 16 (Verne)

Please provide any additional information below.

/NFS/projects/PROXY/proxpy-read-only/proxpy.py
[*] <b77e46c0> Server 0.0.0.0 listening on port 8080
[!] <b6cffb40> [Errno 111] Connection refused: 192.168.7.179:443

Debugging:

HMG HTTPRequest:GET http://192.168.7.179:8080/ HTTP/1.0
{REQ #0} method: GET ; host: ('192.168.7.179', 443) ; path: / ; proto: HTTP/1.0 
; len(body): 0

[!] <b6bffb40> [Errno 111] Connection refused: 192.168.7.179:443

Let me know if you need more.

Original issue reported on code.google.com by Henry.Gr...@gmail.com on 4 Feb 2013 at 1:02

GoogleCodeExporter commented 9 years ago
And the fix is ... (drum roll):

diff http.py.orig http.py
231,234c231,235
<             if port is None and r.scheme != "https":
<                 port = 80
<             else:
<                 port = 443
---
>             if port is None:
>                if r.scheme != "https":
>                   port = 80
>                else:
>                   port = 443

Original comment by Henry.Gr...@gmail.com on 4 Feb 2013 at 1:46

GoogleCodeExporter commented 9 years ago

Original comment by roberto.paleari@gmail.com on 18 Nov 2013 at 1:09