Skip navigation
Currently Being Moderated

HTTP tunneling doesn't work with NetConnection

Apr 13, 2012 1:32 PM

I'm researching a problem with NetConnection failing to connect through a proxy server using RTMP and RTMPS protocols. In my test I setup squid as the local proxy server and tried to call connect method on a NetConnection with proxyType = "best". When direct connection fails NetConnection correctly tries to use HTTP CONNECT method to tunnel the rtmp connection through the proxy server. But all I can see in the proxy logs is:

1334347990.276      0 127.0.0.1 TCP_DENIED/400 1552 NONE NONE:// - NONE/- text/html

The connection fails in the result. So, with the internet access through a proxy server RTMP/RTMPS protocols do not work at all.

 

I did some traffic capturing and discovered that NetConnection builds HTTP CONNECT request for server.com as:

"CONNECT server.com:443 HTTP/1.1 \r\n\r\n".

Please pay attention to the space (0x20) character between "HTTP/1.1" and "\r\n\r\n". For a request like that my proxy server returns "HTTP/1.0 400 Bad Request" response.

 

Then I tried to build my own HTTP CONNECT request and discovered that it only works if the space character is removed:

"CONNECT server.com:443 HTTP/1.1\r\n\r\n".

 

With the fix above RTMP/RTMPS tunneling works just fine. I'm surprised this is not a well known problem. Maybe it is a squid specific issue. Or there is something wrong with my environment (I'm not sure if AIR is responsible for building HTTP CONNECT request). So, please advise if it is a bug and anyone had the same problem. Any workarounds would be welcomed as well.

 
Replies

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points