Skip to content

Commit 35299e2

Browse files
committed
version 40
1 parent 68c03ea commit 35299e2

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

README.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ It comes with various options that can manipulate the response output, see the t
88

99
![browser](./screenshots/screenshot.png)
1010

11-
The image is available on [Docker Hub](https://hub.docker.com/r/mendhak/http-https-echo): `mendhak/http-https-echo:39`
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:39`
11+
The image is available on [Docker Hub](https://hub.docker.com/r/mendhak/http-https-echo): `mendhak/http-https-echo:40`
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:40`
1313

1414
Please do not use the `:latest` tag as it will break without warning, use a specific version instead.
1515

@@ -44,7 +44,7 @@ This image is executed as non root by default and is fully compliant with Kubern
4444

4545
Run with Docker
4646

47-
docker run -p 8080:8080 -p 8443:8443 --rm -t mendhak/http-https-echo:39
47+
docker run -p 8080:8080 -p 8443:8443 --rm -t mendhak/http-https-echo:40
4848

4949
Or run with Docker Compose
5050

@@ -61,13 +61,13 @@ You can choose a different internal port instead of 8080 and 8443 with the `HTTP
6161

6262
In this example I'm setting http to listen on 8888, and https to listen on 9999.
6363

64-
docker run -e HTTP_PORT=8888 -e HTTPS_PORT=9999 -p 8080:8888 -p 8443:9999 --rm -t mendhak/http-https-echo:39
64+
docker run -e HTTP_PORT=8888 -e HTTPS_PORT=9999 -p 8080:8888 -p 8443:9999 --rm -t mendhak/http-https-echo:40
6565

6666

6767
With docker compose, this would be:
6868

6969
my-http-listener:
70-
image: mendhak/http-https-echo:39
70+
image: mendhak/http-https-echo:40
7171
environment:
7272
- HTTP_PORT=8888
7373
- HTTPS_PORT=9999
@@ -83,7 +83,7 @@ The certificates are at `/app/fullchain.pem` and `/app/testpk.pem`.
8383
You can use volume mounting to substitute the certificate and private key with your own.
8484

8585
my-http-listener:
86-
image: mendhak/http-https-echo:39
86+
image: mendhak/http-https-echo:40
8787
ports:
8888
- "8080:8080"
8989
- "8443:8443"
@@ -98,7 +98,7 @@ You can use the environment variables `HTTPS_CERT_FILE` and `HTTPS_KEY_FILE` to
9898

9999
If you specify the header that contains the JWT, the echo output will contain the decoded JWT. Use the `JWT_HEADER` environment variable for this.
100100

101-
docker run -e JWT_HEADER=Authentication -p 8080:8080 -p 8443:8443 --rm -it mendhak/http-https-echo:39
101+
docker run -e JWT_HEADER=Authentication -p 8080:8080 -p 8443:8443 --rm -it mendhak/http-https-echo:40
102102

103103

104104
Now make your request with `Authentication: eyJ...` header (it should also work with the `Authentication: Bearer eyJ...` schema too):
@@ -111,7 +111,7 @@ And in the output you should see a `jwt` section.
111111

112112
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.
113113

114-
docker run --rm -e DISABLE_REQUEST_LOGS=true --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo:39
114+
docker run --rm -e DISABLE_REQUEST_LOGS=true --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo:40
115115

116116

117117
## Do not log specific path
@@ -120,12 +120,12 @@ Set the environment variable `LOG_IGNORE_PATH` to a path or a regex you would li
120120
This can help reduce noise from healthchecks in orchestration/infrastructure like Swarm, Kubernetes, ALBs, etc.
121121

122122
# Ignore a single path
123-
docker run -e LOG_IGNORE_PATH=/ping -p 8080:8080 -p 8443:8443 --rm -t mendhak/http-https-echo:39
123+
docker run -e LOG_IGNORE_PATH=/ping -p 8080:8080 -p 8443:8443 --rm -t mendhak/http-https-echo:40
124124
# Ignore multiple paths
125-
docker run -e LOG_IGNORE_PATH="^\/ping|^\/health|^\/metrics" -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo:39
125+
docker run -e LOG_IGNORE_PATH="^\/ping|^\/health|^\/metrics" -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo:40
126126
# Ignore all paths
127-
docker run -e LOG_IGNORE_PATH=".*" -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo:39
128-
docker run -e LOG_IGNORE_PATH="^" -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo:39
127+
docker run -e LOG_IGNORE_PATH=".*" -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo:40
128+
docker run -e LOG_IGNORE_PATH="^" -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo:40
129129

130130

131131

@@ -152,15 +152,15 @@ Will contain a `json` property in the response/output.
152152
You can disable new lines in the log output by setting the environment variable `LOG_WITHOUT_NEWLINE`. For example,
153153

154154
```bash
155-
docker run -e LOG_WITHOUT_NEWLINE=true -p 8080:8080 -p 8443:8443 --rm -t mendhak/http-https-echo:39
155+
docker run -e LOG_WITHOUT_NEWLINE=true -p 8080:8080 -p 8443:8443 --rm -t mendhak/http-https-echo:40
156156
```
157157

158158
## Send an empty response
159159

160160
You can disable the JSON output in the response by setting the environment variable `ECHO_BACK_TO_CLIENT`. For example,
161161

162162
```bash
163-
docker run -e ECHO_BACK_TO_CLIENT=false -p 8080:8080 -p 8443:8443 --rm -t mendhak/http-https-echo:39
163+
docker run -e ECHO_BACK_TO_CLIENT=false -p 8080:8080 -p 8443:8443 --rm -t mendhak/http-https-echo:40
164164
```
165165

166166
## Custom status code
@@ -241,7 +241,7 @@ You can have environment variables (that are visible to the echo server's proces
241241
Pass the `ECHO_INCLUDE_ENV_VARS=1` environment variable in.
242242

243243
```bash
244-
docker run -d --rm -e ECHO_INCLUDE_ENV_VARS=1 --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo:39
244+
docker run -d --rm -e ECHO_INCLUDE_ENV_VARS=1 --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo:40
245245
```
246246

247247
Then do a normal request via curl or browser, and you will see the `env` property in the response body.
@@ -281,7 +281,7 @@ openssl pkcs12 -export -in cert.pem -inkey testpk.pem -out certpkcs12.pfx
281281
By default, the headers in the response body are lowercased. To attempt to preserve the case of headers in the response body, set the environment variable `PRESERVE_HEADER_CASE` to true.
282282

283283
```bash
284-
docker run -e PRESERVE_HEADER_CASE=true -p 8080:8080 -p 8443:8443 --rm -t mendhak/http-https-echo:39
284+
docker run -e PRESERVE_HEADER_CASE=true -p 8080:8080 -p 8443:8443 --rm -t mendhak/http-https-echo:40
285285
```
286286

287287
## Override the response body with a file
@@ -290,23 +290,23 @@ To override the response body with a file, set the environment variable `OVERRID
290290
The file path needs to be in the `/app` directory.
291291

292292
```bash
293-
docker run -d --rm -v ${PWD}/test.html:/app/test.html -p 8080:8080 -e OVERRIDE_RESPONSE_BODY_FILE_PATH=/test.html -t mendhak/http-https-echo:39
293+
docker run -d --rm -v ${PWD}/test.html:/app/test.html -p 8080:8080 -e OVERRIDE_RESPONSE_BODY_FILE_PATH=/test.html -t mendhak/http-https-echo:40
294294
```
295295

296296
## Set a maximum header size
297297

298298
You can use the `MAX_HEADER_SIZE` environment variable to set a maximum header size in bytes. The default is 1MB.
299299

300300
```bash
301-
docker run -d --rm -e MAX_HEADER_SIZE=1000 -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo:39
301+
docker run -d --rm -e MAX_HEADER_SIZE=1000 -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo:40
302302
```
303303

304304
## Cookies and Signed Cookies
305305

306306
Make a request with a `Cookie` header and the response will include the cookies:
307307

308308
```bash
309-
docker run -d --rm --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo:39
309+
docker run -d --rm --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo:40
310310
```
311311

312312
Then make a request with a cookie header:
@@ -318,7 +318,7 @@ curl -s http://localhost:8080/ -H "Cookie: foo=bar; baz=qux"
318318
To enable signed cookie support, set the `COOKIE_SECRET` environment variable. Signed cookies appear in the `signedCookies` section of the response:
319319

320320
```bash
321-
docker run -d --rm -e COOKIE_SECRET=mysecretkey123 --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo:39
321+
docker run -d --rm -e COOKIE_SECRET=mysecretkey123 --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo:40
322322
```
323323

324324
Now you need to generate a signed cookie, and send it in the header. Here's a convenience node snippet:

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '3'
22
services:
33
my-http-listener:
4-
image: mendhak/http-https-echo:39
4+
image: mendhak/http-https-echo:40
55
environment:
66
- HTTP_PORT=8888
77
- HTTPS_PORT=9999

0 commit comments

Comments
 (0)