https://github.com/den1al/request-mirror
A server that reflects the client's request data
https://github.com/den1al/request-mirror
http mirror proxy research security server
Last synced: 11 months ago
JSON representation
A server that reflects the client's request data
- Host: GitHub
- URL: https://github.com/den1al/request-mirror
- Owner: Den1al
- License: mit
- Created: 2019-08-27T13:25:59.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-08-28T13:01:24.000Z (over 6 years ago)
- Last Synced: 2025-01-19T08:42:51.298Z (about 1 year ago)
- Topics: http, mirror, proxy, research, security, server
- Language: JavaScript
- Size: 4.88 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# request-mirror
## About
A server that reflects the client's request data. This is very useful when you want to inspect the HTTP behaviour of a certain HTTP client. In example, when requesting a resource to this server using `curl` with the following command:
```bash
$ curl -d "a:2" http://localhost:1337/lala/dada\?q\=1 | jq
```
We would get:
```json
{
"meta": {
"method": "POST",
"path": "/lala/dada",
"version": "HTTP/1.1"
},
"data": {
"query": "q=1",
"body": "a:2"
},
"headers": [
[
"Host",
" localhost:1337"
],
[
"User-Agent",
" curl/7.54.0"
],
[
"Accept",
" */*"
],
[
"Content-Length",
" 3"
],
[
"Content-Type",
" application/x-www-form-urlencoded"
]
],
"address": "127.0.0.1",
"port": 57983
}
```
## Installation
After cloning this repo, simply install the dependencies with:
```bash
$ npm install
```
## Usage
### Basic
To run the server:
```bash
$ npm start
```
### PM2
To run the server with pm2 (recommended):
```bash
$ npm install -g pm2
$ pm2 start ecosystem.config
```
This will run the server in the background
## Notes
* The header values are the raw values (containing the space at the start).
* This server was written with a custom HTTP parser, that handles only the necessary components.
* This server was created for testing purposes only (use at your own responsability)