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
Copy file name to clipboardExpand all lines: README.md
+13-6Lines changed: 13 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1

2
2
3
-
# Mirror HTTP Server [](https://travis-ci.org/eexit/mirror-http-server)
3
+
# Mirror HTTP Server [](https://travis-ci.org/eexit/mirror-http-server)[](https://hub.docker.com/r/eexit/mirror-http-server/)
4
4
5
5
*A dummy HTTP server that responds whatever you told him to.*
6
6
@@ -33,7 +33,7 @@ X-Powered-By: Express
33
33
34
34
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.
35
35
36
-
### Behavioural request headers
36
+
### Server behavioural request headers
37
37
38
38
You can change the server response code and body by setting specific `X-Mirror-*` headers to your request.
Here, simulates a `301` redirection and a `Content-Type` change:
56
56
57
57
http $(docker-machine ip default) \
58
58
X-Mirror-Code:301 \
@@ -74,7 +74,7 @@ If you add the `--follow` option, it will output my website HTML source.
74
74
If you check the container logs:
75
75
76
76
```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:
78
78
request: {
79
79
"ip": "192.168.99.1",
80
80
"ips": [],
@@ -96,7 +96,7 @@ If you check the container logs:
96
96
97
97
### `X-Mirror-Request`
98
98
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):
100
100
101
101
$ http POST $(docker-machine ip default)/resource \
102
102
X-Mirror-Code:201 \
@@ -137,9 +137,11 @@ X-Powered-By: Express
137
137
}
138
138
```
139
139
140
+
Note: if you don't specify the `true` value for the header, it'll ignored.
141
+
140
142
### `X-Mirror-Body`
141
143
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.
143
145
144
146
Note: the `X-Mirror-Request` header will override `X-Mirror-Body` header.
145
147
@@ -162,6 +164,7 @@ X-Powered-By: Express
162
164
"key2": "value2"
163
165
}
164
166
```
167
+
Note: if you don't specify the `true` value for the header, it'll ignored.
0 commit comments