Skip to content

Commit b10252d

Browse files
author
Joris Berthelot
committed
Update README
1 parent 23779e9 commit b10252d

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![logo](logo.png)
22

3-
# Mirror HTTP Server [![Build Status](https://travis-ci.org/eexit/mirror-http-server.svg)](https://travis-ci.org/eexit/mirror-http-server)
3+
# Mirror HTTP Server [![Build Status](https://travis-ci.org/eexit/mirror-http-server.svg)](https://travis-ci.org/eexit/mirror-http-server) [![DockerHub](https://img.shields.io/badge/docker-hub-brightgreen.svg?style=flat)](https://hub.docker.com/r/eexit/mirror-http-server/)
44

55
*A dummy HTTP server that responds whatever you told him to.*
66

@@ -33,7 +33,7 @@ X-Powered-By: Express
3333

3434
You can use any [HTTP verbs](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods) with any path, any request body and any header.
3535

36-
### Behavioural request headers
36+
### Server behavioural request headers
3737

3838
You can change the server response code and body by setting specific `X-Mirror-*` headers to your request.
3939

@@ -52,7 +52,7 @@ Date: Thu, 05 Nov 2015 22:30:11 GMT
5252
X-Powered-By: Express
5353
```
5454

55-
Here, simulate a `301` redirection:
55+
Here, simulates a `301` redirection and a `Content-Type` change:
5656

5757
http $(docker-machine ip default) \
5858
X-Mirror-Code:301 \
@@ -74,7 +74,7 @@ If you add the `--follow` option, it will output my website HTML source.
7474
If you check the container logs:
7575

7676
```json
77-
[2015-11-05T22:48:59.564Z] INFO: mirror-server/18 on 6cb74ed853b0:
77+
[2015-11-05T22:48:59.564Z] INFO: mirror-http-server/18 on 6cb74ed853b0:
7878
request: {
7979
"ip": "192.168.99.1",
8080
"ips": [],
@@ -96,7 +96,7 @@ If you check the container logs:
9696

9797
### `X-Mirror-Request`
9898

99-
If you access to the server logs or want to exploit the what's logged, set the `X-Mirror-Request` to receive what's logged in a JSON format:
99+
If you can't access to the container log or want to exploit what's logged under the hood, set the `X-Mirror-Request` to receive the logged entry (as JSON):
100100

101101
$ http POST $(docker-machine ip default)/resource \
102102
X-Mirror-Code:201 \
@@ -137,9 +137,11 @@ X-Powered-By: Express
137137
}
138138
```
139139

140+
Note: if you don't specify the `true` value for the header, it'll ignored.
141+
140142
### `X-Mirror-Body`
141143

142-
Instead, if you with the dummy server to return you the same body you requested to it, set the `X-Mirror-Body` header.
144+
Instead, if you wish the dummy server to return you the body you sent to it, set the `X-Mirror-Body` header.
143145

144146
Note: the `X-Mirror-Request` header will override `X-Mirror-Body` header.
145147

@@ -162,6 +164,7 @@ X-Powered-By: Express
162164
"key2": "value2"
163165
}
164166
```
167+
Note: if you don't specify the `true` value for the header, it'll ignored.
165168

166169
### Works for all headers
167170

@@ -193,3 +196,7 @@ Will turn into:
193196
X-Powered-By: eexit-engine
194197
Date: some date
195198
```
199+
200+
## Todo
201+
202+
- Functional testing

0 commit comments

Comments
 (0)