https://github.com/itzg/web-debug-server
A very minimal web server that responds with a page containing the request headers and content
https://github.com/itzg/web-debug-server
Last synced: 5 months ago
JSON representation
A very minimal web server that responds with a page containing the request headers and content
- Host: GitHub
- URL: https://github.com/itzg/web-debug-server
- Owner: itzg
- Created: 2018-10-14T03:59:22.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-12-06T13:48:40.000Z (over 1 year ago)
- Last Synced: 2025-02-01T15:40:50.150Z (5 months ago)
- Language: Go
- Homepage:
- Size: 113 KB
- Stars: 10
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://hub.docker.com/r/itzg/web-debug-server)
[](https://github.com/itzg/web-debug-server/actions/workflows/test.yml)# web-debug-server
A very minimal web server that responds with a page containing the request headers and content
## Usage
```
-bind host:port
The host:port to bind, but using port flag is preferred (env BIND)
-port int
The port to bind (env PORT) (default 8080)
-redirects path=location
Declares path=location mapping of local path to a resulting 307 redirect location (env REDIRECTS)
-response-fixed-body string
When set, specifies a fixed body to write to the response (env RESPONSE_FIXED_BODY)
-response-fixed-content-type string
When FixedBody is set, specifies the content type to set (env RESPONSE_FIXED_CONTENT_TYPE) (default "text/plain")
-response-headers value
List of header:value pairs to include in response (env RESPONSE_HEADERS)
-response-status int
When set, specifies the status code to use in responses (env RESPONSE_STATUS) (default 200)
```## Running as a Docker container
```shell
docker run -it --rm -p 8080:8080 itzg/web-debug-server
```## Examples
If the server is started with `--port 8123`, then accessing [http://localhost:8123?query=testing](http://localhost:8123?query=testing) from a browser would render:

If the server is also given `--redirects /redirect=/`, then accessing [http://localhost:8123/redirect](http://localhost:8123/redirect) would redirect the browser to [http://localhost:8123/](http://localhost:8123/).