Skip to content

Latest commit

 

History

History
57 lines (41 loc) · 1.64 KB

README.md

File metadata and controls

57 lines (41 loc) · 1.64 KB

Http Receiver

Http Receiver is a simple server. It logs all information that is sent to it, and then returns the information provided to it on startup.

This tool simplifies frontend and backend development by allowing you to do two things:

  1. View the information you send from a request. This is useful when working on a backend that hits something else.
  2. Receive any data you want when receiving a response. This can be used to test how your system handles various data.

Installation

  1. Clone the repository: git clone https://github.com/colin99d/http-receiver
  2. Install rust: https://www.rust-lang.org/tools/install
  3. Build the project: cargo build --release
  4. Copy the binary into your bin: cp target/release/http-receiver /usr/local/bin

Usage

To begin using the server, you can simply run http-receiver in your terminal. This will start the server on port 9000. For more advanced usage see our examples below.

Examples

Returning custom json and selecting headers to highlight:

http-receiver -c '{"value1": "key1", "value2": 5 }' --highlight-headers authorization,content-length

Changing the port to 3030 and making the return status code 404:

http-receiver -s 404 -p 3030

Changing the type to html and returning a basic html page:

http-receiver -t html -c '<html><body><h1>Hello World</h1></body></html>'

Returning a custom set cookie header:

http-receiver -H 'Set-Cookie: sessionId=abc123; Path=/; HttpOnly'

Compressing the given text using gzip:

http-receiver -c success -e gzip

Change the host to 0.0.0.0 to allow Docker connections:

http-receiver -a 0.0.0.0