Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
ksenia-vazhdaeva committed Aug 23, 2024
1 parent cc4831f commit dec2223
Showing 1 changed file with 12 additions and 82 deletions.
94 changes: 12 additions & 82 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,91 +1,21 @@
# 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:
![](docs/source/_static/media-gateway.png)

* 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)
## Documentation

To read from and to write to ZeroMQ [savant_core](https://github.com/insight-platform/savant-rs) crate is used.
The documentation is available at [GitHub Pages](https://insight-platform.github.io/MediaGateway/).

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.
## License

Both server and client have a health endpoint.
Media Gateway is licensed under the BSL-1.1 license. See [LICENSE](LICENSE) for more information.

```
GET /health HTTP/1.1
Host: <host>
```
### Obtaining Production-Use License

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).

0 comments on commit dec2223

Please sign in to comment.