Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Sending non-standard ports with Host header. Resolves issue #9

commit ae3f588fea582ef244d32d822fa66e579014bbe8 1 parent 587cfa3
@theturtle32 authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 AS3WebSocket/src/com/worlize/websocket/WebSocket.as
View
7 AS3WebSocket/src/com/worlize/websocket/WebSocket.as
@@ -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";
Please sign in to comment.
Something went wrong with that request. Please try again.