Skip to content

notsobad/go-fakesite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌐 Go-Fakesite

Go-Fakesite 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.

🔧 Installation

To install Go-Fakesite, use the following command:

go install github.com/notsobad/go-fakesite

💻 Usage

To run Go-Fakesite, use the following command:

go-fakesite

You can then access the site at http:https://localhost:9527/.

🌟 Features

📁 Static Files

Visiting the same URL will yield the same result. Use the following format:

/static/$RANDOM.$EXT

Examples:

🌀 Dynamic URLs

Visiting the same URL will yield different results. Use the following format:

/dynamic/$RANDOM.$EXT

Examples:

⚠️ HTTP Status Codes

You can simulate different HTTP status codes. Use the following format:

/code/$CODE.$EXT

Examples:

📈 Specified Size Response

You can output a file of a specified size. Use the following format:

/size/$SIZE.$EXT

Examples:

🐌 Slow Response Server

You can simulate a slow server response. Visit /slow/$SECONDS and the URL will take $SECONDS time to render.

Examples:

🔄 URL Redirect

You can simulate various URL redirect methods. Use the following format:

http:https://localhost:9527/redirect/$CODE?url=$URL

Normal redirect:

You can also redirect to a 'file:https://' protol address:

curl -v 'localhost:9527/redirect/301?url=file:https:///etc/passwd'