Skip to content

Simple echoserver, which dumps HTTP requests.

License

Notifications You must be signed in to change notification settings

ricoberger/echoserver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

echoserver

Simple echoserver, which dumps HTTP requests.

  • /: Dump the HTTP request.
  • /health: Return a 200 status code.
  • /status: Return a random status code, via the ?status=random parameter or a the defined status code via the ?status=200 parameter.
  • /timeout: Wait the given amount of time (?timeout=1m) before returning a 200 status code.
  • /headersize: Returns a 200 status code with a header X-Header-Size of the size defined via ?size=1024.

Build

The echoserver can be built with the following command:

go build
./echoserver

When you are using Docker, you can use the following commands:

docker build -f Dockerfile -t ghcr.io/ricoberger/echoserver:latest .
docker run -it --rm --name echotest -p 8080:8080 ghcr.io/ricoberger/echoserver:latest

Deploy

To deploy the echoserver at Kubernetes run the following commands:

kubectl apply -n test -f https://raw.githubusercontent.com/ricoberger/echoserver/main/deploy/ns.yaml
kubectl apply -n test -f https://raw.githubusercontent.com/ricoberger/echoserver/main/deploy/deploy.yaml
kubectl apply -n test -f https://raw.githubusercontent.com/ricoberger/echoserver/main/deploy/svc.yaml
kubectl apply -n test -f https://raw.githubusercontent.com/ricoberger/echoserver/main/deploy/vs.yaml

Exmples

curl -vvv http://localhost:8080/
curl -vvv http://localhost:8080/status?status=400
curl -vvv http://localhost:8080/timeout?timeout=10s

About

Simple echoserver, which dumps HTTP requests.

Topics

Resources

License

Stars

Watchers

Forks

Packages