View .md

ServerProxyEvent events

2 FeatherPanel plugin events on ServerProxyEvent (2 emitted by the core): the event names, the arguments each listener gets, where they fire and a PHP listener for each.

Last synced from FeatherPanel 15b94e9 on .

On this page

Part of the plugin events reference. Listeners get the payload values as positional arguments in the order shown, cannot cancel the action, and must catch their own exceptions.

Setup

Import ServerProxyEvent in your entry class and register listeners in processEvents():

<?php

namespace App\Addons\myplugin;

use App\App;
use App\Plugins\AppPlugin;
use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\ServerProxyEvent;

class MyPlugin implements AppPlugin
{
    public static function processEvents(PluginEvents $event): void
    {
        $event->on(ServerProxyEvent::onServerProxyCreated(), function ($userUuid, $serverUuid, $proxyId, $domain, $port): void {
            App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:server:proxy:create ' . json_encode(['user_uuid' => $userUuid, 'server_uuid' => $serverUuid, 'proxy_id' => $proxyId, 'domain' => $domain, 'port' => $port]));
        });
    }

    public static function pluginInstall(): void
    {
    }

    public static function pluginUninstall(): void
    {
    }
}

ServerProxyEvent::onServerProxyCreated()

Name: featherpanel:server:proxy:createemitted at 1 siteCancel or modify: nodefinition

Docblock: string user uuid, string server uuid, int|null proxy id, string domain, int port.

#Payload keyListener parameterType
1user_uuid$userUuidstringfrom docblock
2server_uuid$serverUuidstringfrom docblock
3proxy_id$proxyIdint|nullfrom docblock
4domain$domainstringfrom docblock
5port$portint
When it fires (1 site)
$event->on(ServerProxyEvent::onServerProxyCreated(), function ($userUuid, $serverUuid, $proxyId, $domain, $port): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:server:proxy:create ' . json_encode(['user_uuid' => $userUuid, 'server_uuid' => $serverUuid, 'proxy_id' => $proxyId, 'domain' => $domain, 'port' => $port]));
});

ServerProxyEvent::onServerProxyDeleted()

Name: featherpanel:server:proxy:deleteemitted at 1 siteCancel or modify: nodefinition

Docblock: string user uuid, string server uuid, int|null proxy id, string domain, int port.

#Payload keyListener parameterType
1user_uuid$userUuidstringfrom docblock
2server_uuid$serverUuidstringfrom docblock
3proxy_id$proxyIdint
4domain$domainstringfrom docblock
5port$portint
When it fires (1 site)
$event->on(ServerProxyEvent::onServerProxyDeleted(), function ($userUuid, $serverUuid, $proxyId, $domain, $port): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:server:proxy:delete ' . json_encode(['user_uuid' => $userUuid, 'server_uuid' => $serverUuid, 'proxy_id' => $proxyId, 'domain' => $domain, 'port' => $port]));
});