-
Notifications
You must be signed in to change notification settings - Fork 6
Webhooks (beta)
Кирилл Леонов edited this page Nov 28, 2024
·
2 revisions
You can set up webhooks to receive notifications when your clients connect to the VPN and when they disconnect from it. In order to set up webhooks you need to set up a cron task scheduler on your server. The cron task scheduler should run the following command:
docker exec -it <YOUR_CONTAINER_NAME> rake send_events
This command will launch a task to send events. The more often it is triggered, the more accurate the events will be, but I do not recommend doing it more often than once a minute.
Also, in order for everything to work, when launching a container with an application, you need to specify an additional environment variable -> WEBHOOKS_URL
docker run -d \
...
-e WEBHOOKS_URL=https://your_url.api/event \
...
The application will send post requests to the specified address.
content_type => application/json
example body:
{
"peer": "this is public key of your client",
"event": "connected"
}