Skip to content

Commit

Permalink
Merge pull request #14 from sloonz/master
Browse files Browse the repository at this point in the history
Adds port in host request-header during handshake.
  • Loading branch information
fiddur committed Mar 19, 2015
2 parents 8eb985d + 5e1c22c commit 634493a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ protected function connect() {

// Default headers (using lowercase for simpler array_merge below).
$headers = array(
'host' => $host,
'host' => $host . ":" . $port,
'user-agent' => 'websocket-client-php',
'connection' => 'Upgrade',
'upgrade' => 'websocket',
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public function testDefaultHeaders() {

$this->assertRegExp(
"/GET \/$this->test_id HTTP\/1.1\r\n"
. "host: localhost\r\n"
. "host: localhost:".self::$port."\r\n"
. "user-agent: websocket-client-php\r\n"
. "connection: Upgrade\r\n"
. "upgrade: websocket\r\n"
Expand All @@ -251,7 +251,7 @@ public function testUserAgentOverride() {

$this->assertRegExp(
"/GET \/$this->test_id HTTP\/1.1\r\n"
. "host: localhost\r\n"
. "host: localhost:".self::$port."\r\n"
. "user-agent: Deep thought\r\n"
. "connection: Upgrade\r\n"
. "upgrade: websocket\r\n"
Expand All @@ -271,7 +271,7 @@ public function testAddingHeaders() {

$this->assertRegExp(
"/GET \/$this->test_id HTTP\/1.1\r\n"
. "host: localhost\r\n"
. "host: localhost:".self::$port."\r\n"
. "user-agent: websocket-client-php\r\n"
. "connection: Upgrade\r\n"
. "upgrade: websocket\r\n"
Expand Down

0 comments on commit 634493a

Please sign in to comment.