server/proxy/modules/README.md
freerdp-proxy has an API for hooking/filtering certain events/messages.
A module can register callbacks to events, allowing to record the data and control whether to pass/ignore, or right out drop the connection.
During startup, the proxy reads its modules from the configuration:
[Plugins]
Modules = demo,cap
These modules are loaded in a best effort manner. Additionally there is a configuration field for modules that must be loaded, so the proxy refuses to start if they are not found:
[Plugins]
Required = demo,cap
Modules must be installed as shared libraries in the <base install>/lib/freerdp3/proxy folder and match the pattern
proxy-<name>-plugin.<ext> (e.g. proxy-demo-plugin.so) to be found.
For security reasons loading by full path is not supported and only the installation path is used for lookup.
freerdp/server/proxy/proxy_modules_api.h.proxy_module_entry_point function and register the callbacks you are interested in.connectionInfo* info holds connection info of the raised event.void* param holds the actual event data. It should be casted by the filter to the suitable struct from filters_api.h.BOOL:
FALSE: The event will not be proxied.TRUE: The event will be proxied.A demo can be found in filter_demo.c.