FreeRDP/server/proxy/modules
2021-06-22 08:54:18 +02:00
..
capture Added const to function arguments 2021-02-17 11:29:56 +01:00
demo server: proxy: implement external routing 2020-09-18 09:51:12 +02:00
CMakeLists.txt Replaced CMAKE_[SOURCE|BINARY]_DIR with PROJECT_[SOURCE|BINARY]_DIR 2021-06-22 08:54:18 +02:00
modules_api.h Fixed compilation warnings 2021-06-16 14:26:06 +02:00
README.md server: proxy: improve modules api 2019-08-23 11:58:08 +02:00

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.