planktonicme / phproxyimproved

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

Fails on servers on non-standard ports #14

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Set up a webserver on a non-standard port, and install proxy
2. Use proxy to attempt to go to a web address

What is the expected output? What do you see instead?
I'd expect to get the website.

Instead Firefox reports a "Corrupted Content Error" error.

What seems to be happening is the port number in the reply Location: gets 
duplicated. 

e.g. from a TCP dump of trying to go to http://www.example.com using the proxy 
at http://myhost.homeip.net:9999/proxy/ (output slightly anonymized, but 
consistently):

Request coming in:
==================

POST /proxy/index.php HTTP/1.1
Host: myhost.homeip.net:9999
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:25.0) Gecko/20130729 Firefox/25.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-gb,en-us;q=0.8,en;q=0.5,fr;q=0.3
Accept-Encoding: gzip, deflate
DNT: 1
Referer: http://myhost.homeip.net:9999/proxy/
Cookie: ttrss_sid=6sv7ij1rudk5t7tev5f7kpvta3; 
PHPSESSID=oasangcijegf68p476tv1ssht6
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 106

q=example.com&hl%5Baccept_cookies%5D=on&hl%5Bshow_images%5D=on&hl%5Bshow_referer
%5D=on&hl%5Brotate13%5D=on

Reply sent back:
================
HTTP/1.1 302 Found
Date: Wed, 31 Jul 2013 12:43:51 GMT
Server: Apache/2.2.24 (PCLinuxOS 2011/PREFORK-1pclos2013)
X-Powered-By: PHP/5.3.25
Location: 
http://myhost.homeip.net:9999:9999/proxy/index.php?q=rknzcyr.pbz&hl=2f0
Content-Encoding: gzip
Vary: Accept-Encoding
Content-Length: 25
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html

.........................

Good exchange running on port 80:
=================================
POST /proxy/index.php HTTP/1.0
Host: myhost.homeip.net
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:25.0) Gecko/20130729 Firefox/25.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-gb,en-us;q=0.8,en;q=0.5,fr;q=0.3
Accept-Encoding: gzip, deflate
DNT: 1
Referer: http://myhost.homeip.net/proxy/
Cookie: ttrss_sid=6sv7ij1rudk5t7tev5f7kpvta3; 
PHPSESSID=oasangcijegf68p476tv1ssht6
Content-Type: application/x-www-form-urlencoded
Content-Length: 106
Via: 1.1 admin.office:3128 (squid/2.6.STABLE21)
X-Forwarded-For: 172.16.4.150
Cache-Control: max-age=259200
Connection: keep-alive

HTTP/1.1 302 Found
Date: Wed, 31 Jul 2013 12:51:30 GMT
Server: Apache/2.2.24 (PCLinuxOS 2011/PREFORK-1pclos2013)
X-Powered-By: PHP/5.3.25
Location: http://myhost.homeip.net/proxy/index.php?q=rknzcyr.pbz&hl=2f0
Content-Encoding: gzip
Vary: Accept-Encoding
Content-Length: 25
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html

.....

What version of the product are you using? On what operating system?
phproxyimproved: 0.3
php: 5.3.25
apache: 2.2.24
OS: PCLinuxOS 3.2.18-pclos2.bfs

On what url? or host?

Please provide any additional information below.

Original issue reported on code.google.com by PaulJHer...@gmail.com on 31 Jul 2013 at 12:57