https://github.com/jsnjack/httpecho
HTTP echo server
https://github.com/jsnjack/httpecho
Last synced: 9 months ago
JSON representation
HTTP echo server
- Host: GitHub
- URL: https://github.com/jsnjack/httpecho
- Owner: jsnjack
- License: apache-2.0
- Created: 2021-01-13T11:11:08.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-01-12T13:03:48.000Z (over 1 year ago)
- Last Synced: 2025-02-10T16:57:38.272Z (over 1 year ago)
- Language: CSS
- Size: 66.4 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# httpecho
## Overview
`httpecho` is an HTTP echo server that allows you to test various HTTP request and response behaviors. It supports several query parameters to adjust the response behavior.
By default, it returns the request headers in the response. The order and case of the headers are preserved.
## Installation
```sh
grm install jsnjack/httpecho
```
## Usage
To start the HTTP echo server, use the following command:
```sh
httpecho start
```
### Query Parameters
- `sleep`: Delay the response for the specified duration. Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". Example: `?sleep=5s`
- `status`: Return the response with the specified status code. Example: `?status=200`
- `size`: On top of headers, add data of specific size to the response body. Supported units are "KB", "MB", "GB". Example: `?size=200KB`
- `header`: Add additional headers to the response. Example: `?header=Content-Type:text/plain`
- `verbose`: Log the full request (headers and body) to stdout. Example: `?verbose=true`
### Example
To start the server on a specific address and port:
```sh
httpecho start --bind 127.0.0.1:8008
```
To start the server with a certificate for HTTPS:
```sh
httpecho start --bind 127.0.0.1:8008 --cert /path/to/cert.pem
```