The media gateway provides a functionality to forward messages from one ZeroMQ instance to another. The media gateway consists of two applications - a server and client. The client reads messages from the source ZeroMQ instance and sends them to the server via HTTP/HTTPS. The server writes received messages to the target ZeroMQ instance.
Following optional features are supported:
- basic authentication
- HTTPS (including a self-signed PEM encoded certificate)
- client certificate authentication (for the server X509_LOOKUP_hash_dir method is used to load certificates and CRLs)
- FPS statistics logging (by frame or timestamp period)
To read from and to write to ZeroMQ savant_core crate is used.
Both server and client applications are configured via JSON files. in_stream
in the client configuration corresponds
to ReaderConfig
and out_stream
in the server configuration corresponds to
WriterConfig.
Examples of configuration files can be found in samples directory.
Both server and client have a health endpoint.
GET /health HTTP/1.1
Host: <host>
If the server/client is healthy an HTTP response with 200 OK status code and the body as below will be returned.
{
"status": "healthy"
}
Both server and client can be run as Docker containers.
To run the server with the default configuration and to mount /tmp
directory and publish the port from the default configuration
docker run \
-v /tmp:/tmp \
-p 8080:8080 \
ghcr.io/insight-platform/media-gateway-server:latest
To run the server with another configuration (/home/user/server_config.json
)
docker run \
-v /home/user/server_config.json:/opt/etc/custom_config.json \
-p HOST_PORT:CONFIG_PORT \
ghcr.io/insight-platform/media-gateway-server:latest \
/opt/etc/custom_config.json
To run the client with the default configuration, to mount /tmp
directory and publish the port from the default configuration
docker run \
-v /tmp:/tmp \
-p 8081:8081 \
-e "GATEWAY_URL=<GATEWAY_URL>" \
ghcr.io/insight-platform/media-gateway-client:latest
where <GATEWAY_URL>
is the server URL, e.g. http://192.168.0.100:8080
To run the server with another configuration (/home/user/client_config.json
)
docker run \
-v /home/user/client_config.json:/opt/etc/custom_config.json \
-p <HOST_PORT>:<CONFIG_PORT> \
ghcr.io/insight-platform/media-gateway-client:latest \
/opt/etc/custom_config.json
where <CONFIG_PORT>
is the port specified in the configuration file and <HOST_PORT>
is the port on the host machine.