Configuring the Directory Agent for Remote Connections
If you want to use MERLIC via remote connections, you have to configure the Directory Agent to expose the MERLIC services on the network. The Directory Agent can be configured to expose the MERLIC services over HTTP and WebSocket on a TCP port. Optionally, Transport Layer Security (TLS) can be configured to ensure encrypted connections. The following sections describe the settings required for remote connections. For a full list of configuration options for the Directory Agent, see MERLIC Directory Agent Configuration File.
Activating the TCP/HTTP Server
This setting is mandatory to enable remote connections.
-
Open the configuration file of the MERLIC Directory Agent. By default, you can find the file in the following location:
- Windows: "%APPDATA%\MVTec\directory_agent_config.jsonc"
- Linux: "~/.config/MVTec/directory_agent_config.jsonc"
-
To activate the TCP/HTTP server, define the IP address and port number of the network interface on which the HTTP(S) server should listen for incoming connections. These settings must be added to the "TCP" entry. You can copy the example code, insert it to your configuration file and adjust it to your application.
Copy"TCP": {
"IP": "::", // listen on all network interfaces (IPv4 and IPv6)
"Port": 8090,
"TLS": null
}In this example configuration, Transport Layer Security (TLS) is set to null and therefore disabled.
- Adapt the IP address if required, for example, if only a specific network interface should listen for incoming connections. The IP must be specified as IPv4 or IPv6 address. Hostnames are not resolved and therefore not be used.
- Adapt the port number if required. You can set it to any port number in the range of 1-65535.
Keep in mind that some ports might be reserved and privileged only for users with the respective capabilities. For example, the ports 0 - 1023 are privileged ports on Linux.
MERLIC is now configured to allow remote connections.
Enabling Transport Layer Security (TLS)
This setting is optional for remote connections but it is mandatory to ensure encrypted remote connections.
-
Open the configuration file of the MERLIC Directory Agent. By default, you can find the file in the following location:
- Windows: "%APPDATA%\MVTec\directory_agent_config.jsonc"
- Linux: "~/.config/MVTec/directory_agent_config.jsonc"
-
Make sure the TCP/HTTP server is enabled, and the IP address and port number are defined.
- To enable TLS-encryption, define the path to the server certificate and private server key to the "TLS", which is part of the "TCP" entry. You can copy the example code, insert it to your configuration file and adjust it to your application.Copy
"TCP": {
"IP": "::", // listen on all network interfaces (IPv4 and IPv6)
"Port": 8443,
"TLS": {
"CertFile": "/path/to/server.crt",
"KeyFile": "/path/to/server.key"
}
} - Adapt the path to the server certificate and the private server key as required. It is recommended to use absolute paths. If you have no server certificate or server private key, see Getting Started with X.509 Certificates for more information on how to create the required certificates.
MERLIC is now configured for TLS-encrypted connections.