Skip to content

Commit

Permalink
Sending non-standard ports with Host header. Resolves issue theturtle…
Browse files Browse the repository at this point in the history
  • Loading branch information
theturtle32 committed Aug 25, 2012
1 parent 587cfa3 commit ae3f588
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion AS3WebSocket/src/com/worlize/websocket/WebSocket.as
Expand Up @@ -680,9 +680,14 @@ package com.worlize.websocket
private function sendHandshake():void {
serverHandshakeResponse = "";

var hostValue:String = host;
if ((_secure && _port !== 443) || (!_secure && _port !== 80)) {
hostValue += (":" + _port.toString());
}

var text:String = "";
text += "GET " + resource + " HTTP/1.1\r\n";
text += "Host: " + host + "\r\n";
text += "Host: " + hostValue + "\r\n";
text += "Upgrade: websocket\r\n";
text += "Connection: Upgrade\r\n";
text += "Sec-WebSocket-Key: " + base64nonce + "\r\n";
Expand Down

0 comments on commit ae3f588

Please sign in to comment.