mendhak/http-https-echo is a Docker image that can echo various HTTP request properties back to client, as well as in the Docker container logs.
You can use your own certificates, choose your ports, decode JWT headers and filter out certain paths.
This image is executed as non root by default and is fully compliant with Kubernetes or Openshift deployment.
Please do not use the :latest tag as it will break without warning, use a specific version instead.
Basic Usage
Run with Docker
docker run -p 8080:8080 -p 8443:8443 --rm -t mendhak/http-https-echo:24
Or run with Docker Compose
docker-compose up
Then, issue a request via your browser or curl, and watch the response, as well as container log output.
curl -k -X PUT -H "Arbitrary:Header" -d aaa=bbb https://localhost:8443/hello-world
Choose your ports
You can choose a different internal port instead of 8080 and 8443 with the HTTP_PORT and HTTPS_PORT environment variables.
In this example I'm setting http to listen on 8888, and https to listen on 9999.
In the log output set the environment variable DISABLE_REQUEST_LOGS to true, to disable the specific ExpressJS request log lines. The ones like ::ffff:172.17.0.1 - - [03/Jan/2022:21:31:51 +0000] "GET /xyz HTTP/1.1" 200 423 "-" "curl/7.68.0". The JSON output will still appear.
Set the environment variable LOG_IGNORE_PATH to a path you would like to exclude from verbose logging to stdout.
This can help reduce noise from healthchecks in orchestration/infrastructure like Swarm, Kubernetes, ALBs, etc.
请发表评论