Skip to content
This repository has been archived by the owner on Jan 17, 2022. It is now read-only.

fix(config): set default host value to '0.0.0.0' #55

Merged
merged 2 commits into from
May 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/configuration-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Documentation of available configuration parameters. See also symfony [bundle co
swoole:
http_server:
port: 9501
host: localhost
host: 0.0.0.0
running_mode: process
socket_type: tcp
ssl_enabled: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function getConfigTreeBuilder(): TreeBuilder
->children()
->scalarNode('host')
->cannotBeEmpty()
->defaultValue('127.0.0.1')
->defaultValue('0.0.0.0')
->end()
->scalarNode('port')
->cannotBeEmpty()
Expand Down
2 changes: 1 addition & 1 deletion src/Server/Config/Socket.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ final class Socket
*
* @throws \Assert\AssertionFailedException
*/
public function __construct(string $host = 'localhost', int $port = 9501, string $type = 'tcp', bool $ssl = false)
public function __construct(string $host = '0.0.0.0', int $port = 9501, string $type = 'tcp', bool $ssl = false)
{
$this->setHost($host);
$this->setPort($port);
Expand Down
2 changes: 1 addition & 1 deletion tests/Fixtures/Symfony/app/config/swoole.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
parameters:
env(PORT): 9501
env(HOST): localhost
env(HOST): 0.0.0.0
env(TRUSTED_HOSTS): localhost,127.0.0.1
env(TRUSTED_PROXIES): '*,196.168.0.0/16'

Expand Down