Skip to content

Commit

Permalink
Update WebSocket.php
Browse files Browse the repository at this point in the history
Pull DNS server from env variable. Fallback to google public DNS if not set.
  • Loading branch information
donjuanica committed Aug 14, 2015
1 parent 5c495fa commit b07013d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Devristo/Phpws/Client/WebSocket.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ public function __construct($url, LoopInterface $loop, LoggerInterface $logger,
throw new WebSocketInvalidUrlScheme();

$dnsResolverFactory = new \React\Dns\Resolver\Factory();
$this->dns = $dnsResolverFactory->createCached('8.8.8.8', $loop);
$server = false === getenv('DNS_SERVER') ? '8.8.8.8' : getenv('DNS_SERVER');
$this->dns = $dnsResolverFactory->createCached($server, $loop);
}

public function open($timeOut=null)
Expand Down

0 comments on commit b07013d

Please sign in to comment.