https://github.com/codesoap/preq
an http requester for the httpipe format
https://github.com/codesoap/preq
httpipe
Last synced: 11 months ago
JSON representation
an http requester for the httpipe format
- Host: GitHub
- URL: https://github.com/codesoap/preq
- Owner: codesoap
- License: mit
- Created: 2023-12-18T18:41:35.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-04-01T09:23:09.000Z (about 2 years ago)
- Last Synced: 2025-05-17T09:11:25.347Z (about 1 year ago)
- Topics: httpipe
- Language: Go
- Homepage:
- Size: 12.7 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
preq is an HTTP requester for the [httpipe
format](https://github.com/codesoap/httpipe). It takes httpipe input via
standard input, makes the given requests and prints httpipe to standard
output.
preq is designed to be used with HTTP 1.1 requests only and does not
support the CONNECT method.
# Examples
```console
$ echo '{"host":"x.com","req":"GET / HTTP/1.1\\r\\nHost: x.com\\r\\n\\r\\n"}' | preq
{"host":"x.com","port":443,"req":"GET / HTTP/1.1\r\nHost: x.com\r\n\r\n","resp":"HTTP/1.1 302 Moved Temporarily\r\n ... "}
$ # Using pfuzz to generate requests and drip to limit the request rate:
$ pfuzz -w /path/to/wordlist -u 'https://foo.com/FUZZ' | drip 500ms | preq -p 20
...
```
# Installation
You can download precompiled binaries from the [releases
page](https://github.com/codesoap/preq/releases) or install it with
`go install github.com/codesoap/preq@latest`.
# Usage
```console
$ preq -h
Usage of preq:
-p int
Number of parallel requests. (default 1)
-t duration
Timeout for requests. (default 5s)
preq expects input via standard input in the httpipe format. At least
the "host" and "req" fields must be present. If the "tls" field is
missing, TLS (HTTPS) will be used. If the "port" field is missing, port
80 will be used if TLS is not used and port 443 otherwise.
preq will make requests in the order they arrived via standard input.
However, if the value of the -p flag is greater than 1, the order of the
output lines may not match the input.
Example:
echo '{"host":"x.com","req":"GET / HTTP/1.1\\r\\nHost: x.com\\r\\n\\r\\n"}' | preq
```