Go-Dummy-Site is a mock website generator for HTTP testing. It is a Go version of ynm3k. This tool is designed to simulate various URL addresses, static and dynamic web pages, different status codes, response sizes, and more. It is particularly useful for testing CDN and WAF systems.
To install Go-Dummy-Site, use the following command:
go install github.com/notsobad/go-dummysite
To run Go-Dummy-Site, use the following command:
go-dummysite
You can then access the site at http://localhost:9527/.
Visiting the same URL will yield the same result. Use the following format:
/static/$RANDOM.$EXT
Examples:
Visiting the same URL will yield different results. Use the following format:
/dynamic/$RANDOM.$EXT
Examples:
You can simulate different HTTP status codes. Use the following format:
/code/$CODE.$EXT
Examples:
You can output a file of a specified size. Use the following format:
/size/$SIZE.$EXT
Examples:
You can simulate a slow server response. Visit /slow/$SECONDS
and the URL will take $SECONDS time to render.
Examples:
You can simulate various URL redirect methods. Use the following format:
http://localhost:9527/redirect/$CODE?url=$URL
Normal redirect:
- /redirect/301?url=http://www.notsobad.vip
- /redirect/302?url=http://www.notsobad.vip
- /redirect/js?url=http://www.notsobad.vip
- /redirect/meta?url=http://www.notsobad.vip
You can also redirect to a 'file://' protol address:
curl -v 'localhost:9527/redirect/301?url=file:///etc/passwd'
You can simulate chunked http response. Use the following format, $COUNT
is the count of chunked message.
http://localhost:9527/chunk/$COUNT
Examples:
You can view raw http request and request body in the /trace
api.
in cmd line:
# post
curl 127.1:9527/trace -d 'a=1'