Skip to content

Commit

Permalink
Daemon\Server: Change default listen config
Browse files Browse the repository at this point in the history
resolves #239
  • Loading branch information
nilmerg committed Jul 22, 2024
1 parent 458bcdf commit e0e3eb7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions doc/06-Desktop-Notifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ In there, add a new section with the following content:

```ini
[daemon]
host = [::] ; The IP address to listen on
port = 9001 ; The port to listen on
host = 127.0.0.1 ; The IP address to listen on
port = 5664 ; The port to listen on
```

The values shown above are the default values. You can adjust them to your needs.
Expand All @@ -63,16 +63,16 @@ daemon's configuration.
<LocationMatch "^/icingaweb2/notifications/v(?<version>\d+)/subscribe">
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
RequestHeader set X-Icinga-Notifications-Protocol-Version %{MATCH_VERSION}e
ProxyPass http://127.0.0.1:9001 connectiontimeout=30 timeout=30 flushpackets=on
ProxyPassReverse http://127.0.0.1:9001
ProxyPass http://127.0.0.1:5664 connectiontimeout=30 timeout=30 flushpackets=on
ProxyPassReverse http://127.0.0.1:5664
</LocationMatch>
```

**Nginx**

```
location ~ ^/icingaweb2/notifications/v(\d+)/subscribe$ {
proxy_pass http://127.0.0.1:9001;
proxy_pass http://127.0.0.1:5664;
proxy_set_header Connection "";
proxy_set_header X-Icinga-Notifications-Protocol-Version $1;
proxy_http_version 1.1;
Expand Down
4 changes: 2 additions & 2 deletions library/Notifications/Daemon/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ public function load(): void

$this->connections = [];
$this->socket = new SocketServer(
$this->config->get('daemon', 'host', '[::]')
$this->config->get('daemon', 'host', '127.0.0.1')
. ':'
. $this->config->get('daemon', 'port', '9001'),
. $this->config->get('daemon', 'port', '5664'),
[],
$this->mainLoop
);
Expand Down

0 comments on commit e0e3eb7

Please sign in to comment.