Skip to content

Commit 1434add

Browse files
committed
Resolve target hosts against hosts file (localhost etc.)
1 parent 691b4d3 commit 1434add

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"evenement/evenement": "^3.0 || ^2.0 || ^1.0",
1616
"react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3",
1717
"react/promise": "^2.0 || ^1.0",
18-
"react/socket": "^1.0 || ^0.8 || ^0.7"
18+
"react/socket": "^1.0 || ^0.8.2"
1919
},
2020
"require-dev": {
2121
"phpunit/phpunit": "^5.0 || ^4.8"

src/Factory.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,6 @@ private function parseUrl($target)
7272
$parts['port'] = '5038';
7373
}
7474

75-
if ($parts['host'] === 'localhost') {
76-
$parts['host'] = '127.0.0.1';
77-
}
78-
7975
return $parts;
8076
}
8177
}

tests/FactoryTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ public function testCreateClientUsesTcpConnectorWithDefaultLocation()
2929
$this->factory->createClient();
3030
}
3131

32-
public function testCreateClientUsesTcpConnectorWithLocalhostLocation()
32+
public function testCreateClientUsesDefaultPortForTcpConnection()
3333
{
3434
$promise = new Promise(function () { });
35-
$this->tcp->expects($this->once())->method('connect')->with('127.0.0.1:5038')->willReturn($promise);
35+
$this->tcp->expects($this->once())->method('connect')->with('localhost:5038')->willReturn($promise);
3636

3737
$this->factory->createClient('localhost');
3838
}

0 commit comments

Comments
 (0)