-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cc4831f
commit 969bd16
Showing
1 changed file
with
11 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,91 +1,19 @@ | ||
# Media Gateway | ||
|
||
The media gateway provides a functionality to forward messages from one [ZeroMQ](https://zeromq.org/) 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. | ||
Media Gateway is a service that provides a secure bridge (with encryption and authentication) between Savant edge and | ||
cloud components by forwarding messages from one ZeroMQ socket to another. The media gateway consists of two parts - a | ||
server and client. The client reads messages from the source ZeroMQ socket and sends them to the server via HTTP/HTTPS. | ||
The server writes received messages to the target ZeroMQ socket. | ||
|
||
Following optional features are supported: | ||
## Documentation | ||
|
||
* basic authentication | ||
* HTTPS (including a self-signed PEM encoded certificate) | ||
* client certificate authentication (for the server | ||
[X509_LOOKUP_hash_dir method](https://www.openssl.org/docs/man1.1.1/man3/X509_LOOKUP_hash_dir.html) is used to load | ||
certificates and CRLs) | ||
* FPS statistics logging (by frame or timestamp period) | ||
The documentation is available at [GitHub Pages](https://insight-platform.github.io/MediaGateway/). | ||
|
||
To read from and to write to ZeroMQ [savant_core](https://github.com/insight-platform/savant-rs) crate is used. | ||
## License | ||
|
||
Both server and client applications are configured via JSON files. `in_stream` in the client configuration corresponds | ||
to [ReaderConfig](https://github.com/insight-platform/savant-rs/blob/main/savant_core/src/transport/zeromq/reader_config.rs) | ||
and `out_stream` in the server configuration corresponds to | ||
[WriterConfig](https://github.com/insight-platform/savant-rs/blob/main/savant_core/src/transport/zeromq/writer_config.rs). | ||
Examples of configuration files can be found in [samples](samples) directory. | ||
Media Gateway is licensed under the BSL-1.1 license. See [LICENSE](LICENSE) for more information. | ||
|
||
Both server and client have a health endpoint. | ||
### Obtaining Production-Use License | ||
|
||
``` | ||
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. | ||
|
||
```json | ||
{ | ||
"status": "healthy" | ||
} | ||
``` | ||
|
||
## Docker | ||
|
||
Both server and client can be run as Docker containers. | ||
|
||
### Server | ||
|
||
To run the server with [the default configuration](samples/configuration/server/default_config.json) and to mount `/tmp` | ||
directory and publish the port from the default configuration | ||
|
||
```bash | ||
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`) | ||
|
||
```bash | ||
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](samples/configuration/client/default_config.json), to mount `/tmp` | ||
directory and publish the port from the default configuration | ||
|
||
```bash | ||
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`) | ||
|
||
```bash | ||
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. | ||
To obtain a production-use license, please fill out the form | ||
at [In-Sight Licensing](https://forms.gle/kstX7BrgzqrSLCJ18). |