Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 1 month 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 (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-12-06T13:48:40.000Z (11 months ago)
- Last Synced: 2024-06-19T13:47:32.614Z (5 months ago)
- Language: Go
- Homepage:
- Size: 113 KB
- Stars: 9
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![](https://img.shields.io/docker/pulls/itzg/web-debug-server.svg)](https://hub.docker.com/r/itzg/web-debug-server)
[![test](https://github.com/itzg/web-debug-server/actions/workflows/test.yml/badge.svg)](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:
![](docs/example.png)
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/).