-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
31 lines (23 loc) · 891 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Broken is a simple tool for simulating responses from web applications.
Installation:
`go build broken.go`
Copy or link the binary to a directory in your PATH.
Usage: `broken port_number [log_file]`
Help: `broken [-h] [--help] [help]`
Example: Receive a 403 status code after 10 seconds:
http://localhost:[port]/?status=403&sleep=10000
Status codes:
Broken can respond with a status code of your choice. To get a 404, request:
http://localhost:[port]/?status=404
Requests for status codes other than 3 digits cause an error.
Sleep:
To get a response after x milliseconds, request:
http://localhost:[port]/?sleep=x
Body:
To insert a body in the response, request:
http://localhost:[port]/?body=body_goes_here
Uptime:
To get broken's uptime in milliseconds, request:
http://localhost:[port]/up
Error handling:
On errors, broken responds with a status code of 500 and an error message.