Crates.io | echo-server |
lib.rs | echo-server |
version | 2.0.0 |
source | src |
created_at | 2021-06-06 12:32:09.78332 |
updated_at | 2022-01-24 12:02:35.818056 |
description | HTTP echo server |
homepage | |
repository | |
max_upload_size | |
id | 406855 |
size | 24,932 |
HTTP echo server, that's it.
cargo install echo-server
Defaults:
0.0.0.0:8080
.echo-server [-p|--port=8080] [-b|--body="Custom GET response body"]
All HTTP verbs are supported.
GET
requestcurl -vvv -X GET localhost:8080
curl -vvv -X GET -H "x-random-header: test" localhost:8080
POST
requestcurl -vvv -X POST -H "Content-Type: application/json" -d '{"hello": "world"}' localhost:8080
You can run a precompiled image from Docker hub:
docker run --rm -p 8080:8080 --name echo swaagie/echo-server:latest
Or build the image local:
docker build -t echo-server .
docker run --rm -p 8080:8080 --name echo echo-server
Listen on a different port:
docker run --rm -p 8081:8081 --name echo echo-server --port=8081
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.