cyndilib.discovery.run_server

Utilities for running the built-in Discovery Server

Added in version 0.1.4.

class cyndilib.discovery.run_server.Platform(*values)[source]

Bases: Enum

Enumeration of supported platforms for running the Discovery Server

win32 = 1

32-bit Windows platform

win64 = 2

64-bit Windows platform

macos = 3

macOS platform

linux_i686 = 4

Linux platform (i686)

linux_x86_64 = 5

Linux platform (x86_64)

linux_aarch64 = 6

Linux platform (aarch64)

classmethod current() → Platform | None[source]

Get the member matching the current platform

cyndilib.discovery.run_server.get_run_server_path() → Path[source]

Get the path to the discovery server executable within the package

Raises:

DiscoveryServerUnavailableError – If the discovery server is unavailable for the current platform

cyndilib.discovery.run_server.run() → None[source]

Run the discovery server as a subprocess

While running, the stdout and stderr of the discovery server will be displayed in the terminal. The process will continue running until interrupted by the user (e.g., via Ctrl+C).

Raises:

DiscoveryServerUnavailableError – If the discovery server is unavailable for the current platform

Usage

cyndilib-discovery-server [-h] [-b BIND] [-p PORT] [-c CONFIG] [-s]
-b <BIND>, --bind <BIND>

Set the IP address to bind to (default: 0.0.0.0).

-p <PORT>, --port <PORT>

Set the port number to bind (0-65535, default: 5959).

-c <CONFIG>, --config <CONFIG>

An alternative config file to get the IP and port on where the service will run.

An example of the JSON configuration file can be seen below:

{
    "binding": "127.0.0.1",
    "port_no": 5959
}
-s <SERVICE>, --service <SERVICE>

Run this in service mode (only for linux/unix).

This option allows the discovery server to run as a background service utilizing systemd or other init systems available on the platform.

If the --config option is specified, it will override both the --bind and --port options.

If no --config option is specified, the values for the --bind and --port options will be used. If no values are provided for these options, they will use the default values or read from the following configuration files depending on the platform:

  • Linux:
    • /etc/ndi/ndi-discovery-service.v1.json

    • /usr/local/etc/ndi/ndi-discovery-service.v1.json

  • Windows:
    • %PROGRAMDATA%\NDI\ndi-discovery-service.v1.json