You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`mendhak/http-https-echo` is a Docker image that can echo various HTTP request properties back to client in the response, as well as in the Docker container logs.
8
7
It comes with various options that can manipulate the response output, see the table of contents for a full list.
The image is available on [Docker Hub](https://hub.docker.com/r/mendhak/http-https-echo): `mendhak/http-https-echo:30`
11
+
The image is available on [Docker Hub](https://hub.docker.com/r/mendhak/http-https-echo): `mendhak/http-https-echo:30`
13
12
The image is available on [Github Container Registry](https://github.com/mendhak/docker-http-https-echo/pkgs/container/http-https-echo): `ghcr.io/mendhak/http-https-echo:30`
14
13
15
14
Please do not use the `:latest` tag as it will break without warning, use a specific version instead.
@@ -31,8 +30,11 @@ This image is executed as non root by default and is fully compliant with Kubern
31
30
-[Add a delay before response](#add-a-delay-before-response)
32
31
-[Only return body in the response](#only-return-body-in-the-response)
33
32
-[Include environment variables in the response](#include-environment-variables-in-the-response)
34
-
-[Client certificate details (mTLS) in the response](#client-certificate-details--mtls--in-the-response)
33
+
-[Client certificate details (mTLS) in the response](#client-certificate-details-mtls-in-the-response)
34
+
-[Prometheus Metrics](#prometheus-metrics)
35
35
-[Output](#output)
36
+
-[Curl output](#curl-output)
37
+
-[`docker logs` output](#docker-logs-output)
36
38
-[Building](#building)
37
39
-[Changelog](#changelog)
38
40
@@ -75,9 +77,9 @@ With docker compose, this would be:
75
77
76
78
## Use your own certificates
77
79
78
-
The certificates are at `/app/fullchain.pem` and `/app/privkey.pem`.
80
+
The certificates are at `/app/fullchain.pem` and `/app/privkey.pem`.
79
81
80
-
You can use volume mounting to substitute the certificate and private key with your own.
82
+
You can use volume mounting to substitute the certificate and private key with your own.
Use the querystring parameter, `response_body_only=true` to get just the request body in the response, none of the associated metadata.
232
+
Use the querystring parameter, `response_body_only=true` to get just the request body in the response, none of the associated metadata.
231
233
232
234
```bash
233
235
curl -s -k -X POST -d 'cauliflower' http://localhost:8080/a/b/c?response_body_only=true
234
236
```
235
237
236
-
The output will be 'cauliflower'.
238
+
The output will be 'cauliflower'.
237
239
238
240
## Include environment variables in the response
239
241
240
-
You can have environment variables (that are visible to the echo server's process) added to the response body. Because this could contain sensitive information, it is not a default behavior.
242
+
You can have environment variables (that are visible to the echo server's process) added to the response body. Because this could contain sensitive information, it is not a default behavior.
241
243
242
-
Pass the `ECHO_INCLUDE_ENV_VARS=1` environment variable in.
244
+
Pass the `ECHO_INCLUDE_ENV_VARS=1` environment variable in.
Then do a normal request via curl or browser, and you will see the `env` property in the response body.
250
+
Then do a normal request via curl or browser, and you will see the `env` property in the response body.
249
251
250
252
251
253
## Client certificate details (mTLS) in the response
252
254
253
-
To get client certificate details in the response body, start the container with `MTLS_ENABLE=1` environment variable. When passing a client certificate, the details about that certificate can be echoed back in the response body. The client certificate will not be validated.
255
+
To get client certificate details in the response body, start the container with `MTLS_ENABLE=1` environment variable. When passing a client certificate, the details about that certificate can be echoed back in the response body. The client certificate will not be validated.
254
256
255
-
For example, invoke using curl, passing a certificate and key.
257
+
For example, invoke using curl, passing a certificate and key.
The response body will contain details about the client certificate passed in.
263
+
The response body will contain details about the client certificate passed in.
262
264
263
-
If you browse to https://localhost:8443/ in Firefox, you won't get prompted to supply a client certificate unless you have [an imported certificate by the same issuer as the server](https://superuser.com/questions/1043415/firefox-doesnt-ask-me-for-a-certificate-when-visiting-a-site-that-needs-one). If you need browser prompting to work, you'll need to follow the 'use your own certificates' section. Firefox needs the imported certificate to be in a PKCS12 format, so if you have a certificate and key already, you can combine them using
265
+
If you browse to https://localhost:8443/ in Firefox, you won't get prompted to supply a client certificate unless you have [an imported certificate by the same issuer as the server](https://superuser.com/questions/1043415/firefox-doesnt-ask-me-for-a-certificate-when-visiting-a-site-that-needs-one). If you need browser prompting to work, you'll need to follow the 'use your own certificates' section. Firefox needs the imported certificate to be in a PKCS12 format, so if you have a certificate and key already, you can combine them using
0 commit comments