We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 1809f27 + bba8afd commit 8284dc1Copy full SHA for 8284dc1
src/React/Socket/Server.php
@@ -18,6 +18,11 @@ public function __construct(LoopInterface $loop)
18
19
public function listen($port, $host = '127.0.0.1')
20
{
21
+ if (strpos($host, ':') !== false) {
22
+ // enclose IPv6 addresses in square brackets before appending port
23
+ $host = '[' . $host . ']';
24
+ }
25
+
26
$this->master = @stream_socket_server("tcp://$host:$port", $errno, $errstr);
27
if (false === $this->master) {
28
$message = "Could not bind to tcp://$host:$port: $errstr";
0 commit comments