Skip to content

Provides a HTTP/2 gateway securing edge-cloud communication

License

Notifications You must be signed in to change notification settings

insight-platform/MediaGateway

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
Jul 15, 2024
Jul 8, 2024
Jul 2, 2024
Jul 15, 2024
Jul 12, 2024
Jul 4, 2024
Jul 12, 2024
Jul 15, 2024
Jun 26, 2024
Jun 12, 2024
Jul 17, 2024
Jul 12, 2024
Jun 12, 2024
Jul 12, 2024

Repository files navigation

Media Gateway

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.

The server has a health endpoint.

 GET /health HTTP/1.1
 Host: <host>

If the server is healthy an HTTP response with 200 OK status code and the body as below will be returned.

{
 "status": "healthy"
}

Docker

Both server and client can be run as Docker containers.

Server

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

Client

To run the client with the default configuration and to mount /tmp directory

docker run \
 -v /tmp:/tmp \
  -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 \
 ghcr.io/insight-platform/media-gateway-client:latest \
 /opt/etc/custom_config.json