FreeRDP/server/proxy/modules
Kobi Mizrachi b2fad50cd3 server: proxy: rewrite modules API
* Add support for C++ plugins.
* Seperate between a "module" and a "plugin": a module is a shared
library that exposes a function called "proxy_module_entry_point". This
function gets a parameter to `proxyPluginsManager*`, which can be used to
register plugins.
* Refine the API of the modules infrastructure:
 * use proxyData* instead of rdpContext* when firing a hook or calling a filter.
 * use clearer names.
* Instead of having to specify a path for each module to be loaded in
the configuration, the proxy now loads modules from specificed
directory, using the CMAKE variable PROXY_PLUGINDIR.
* Add an option to specify required plugins: plugins that the proxy
wouldn't start without having them fully loaded.
2020-01-14 07:58:47 +01:00
..
demo server: proxy: rewrite modules API 2020-01-14 07:58:47 +01:00
CMakeLists.txt
modules_api.h server: proxy: rewrite modules API 2020-01-14 07:58:47 +01:00
README.md

Proxy filter API

freerdp-proxy has an API for filtering certain messages. A filter can register callbacks to events, allowing to record the data and control whether to pass/ignore the message, or right out drop the connection.

During startup, the proxy loads its filters from the configuration:

[Filters]
; FilterName = FilterPath
DemoFilter = "server/proxy/demo.so"

Currently supported events

  • Mouse event
  • Keyboard event

Developing a new filter

  • Create a new file that includes filters_api.h.
  • Implement the filter_init function and register the callbacks you are interested in.
  • Each callback receives two parameters:
    • 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.
  • Each callback must return a PF_FILTER_RESULT:
    • FILTER_IGNORE: The event will not be proxied.
    • FILTER_PASS: The event will be proxied.
    • FILTER_DROP: The entire connection will be dropped.

A demo can be found in filter_demo.c.