# Echo Server

There is an initial version of a simple echo server located at [`nym/tools/echo-server`](https://github.com/nymtech/nym/tree/develop/tools/echo-server).

This is an initial minimal implementation of an echo server built using the [`NymProxyServer`](../rust/tcpproxy) Rust SDK abstraction that, aside from the initialisation and running of a `NymProxyServer` instance in the background, is essentially a vanilla TCP echo server written with `tokio`.

This server was initially built for the `TcpProxy` tests, but can be useful for developers to need a constant endpoint to ping when developing. In the future this will be deployed to a remote server so developers don't have to run their own.

## Build
Run `cargo build --release` from `nym/tools/echo-server`. The binary will be in the main workspace `target/release` dir.

## Run
```sh
Usage: echo-server [OPTIONS]

Options:
  -g, --gateway <GATEWAY>          Optional gateway to use
  -c, --config-path <CONFIG_PATH>  Optional config path to specify
  -e, --env <ENV>                  Optional env file - defaults to Mainnet if None
  -l, --listen-port <LISTEN_PORT>  Listen port [default: 8080]
  -h, --help                       Print help
```

## Logging
Every 10 seconds, the server logs:
- the total number of bytes received since startup
- the total number of bytes sent since startup
- the current number of concurrent connections it has
- the total number of concurrent connections it has
