tags:

views:

253

answers:

2

I am using a 3G UMTS connection. I am trying to implement HTTP tunneling to a server of mine which listens on port 80 (this is done in order to bypass client's firewall). The problem is that the ISP's proxy server supports HTTP/1.0 which doesn't support persistent HTTP connection.

As a result, after one http request/response iteration between my client/server the ISP's proxy tears down the underlying TCP connection.

my client receives the following HTTP response:
HTTP/1.0 200 OK
Content-Type: application/octet-stream
Content-Length: yyy
X-Cache: MISS from ipmr5
Proxy-Connection: close
my data appear here

while my server actually sends:
HTTP/1.1 200 OK
Connection: Keep-Alive
Content-Type: application/octet-stream
Content-Length: yyy
my data appear here

Is there any workaround?

+1  A: 

HTTP 1.0 proxies (which it seems your ISP uses) shouldn't be used in connection with Connection: Keep-Alive for persistent connections. The reasons for this are outlined in RFC-2068 (section 19.7.1). The short version, basically, is that your server is sending an invalid header for the kind of proxy you are using.

GaryF
I didn't choose to use the ISP's proxy, the ISP chose for me.
error.exit
What he means is.. when your client sends a request to the server, the proxy is downgrading it to a http1.0 (or should be), in which case your server shouldn't respond with a http1.1
meandmycode
meandmycode: Suppose that my server responds with http/1.0. Still the proxy will send the "Proxy-Connection: close" and tear down my underlying socket because it doesn't support persistent http.
error.exit
It's hard to say for sure, but I'd say probably yes.
GaryF
But http1.0 doesn't support persistent connections as you understand, the proxy-connection header is a non-standard system for http1.0 persistence, and its completely up to the client/proxy if it supports this.. you could for example get the client to send a proxy-connection: keep-alive header and see if the proxy respects the clients request.
meandmycode
+3  A: 

You could always use HTTPS. You will lose any benefits offered by the proxies (such as caching), but all of your HTTP headers will arrive at the server exactly as you sent them.

I guess that HTTPS traffic sent to port 80 (port 443 is blocked) will go through the ISP's proxy anyway. I am not sure that the proxy will let non HTTP traffic through.
error.exit
I've used this successfully (my network operator proxy forced compressed all responses, which a client couldn't handle). Port 443 wasn't blocked in my case, though ...