Skip to content

kovetskiy/blankd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

blankd

blankd summoned for help with testing software which should do http requests to http servers.

blankd listens specified address and runs specified program on every http request, program should serve that http request and output http response like as following:

HTTP/1.1 200 OK
Connection: Close
X-Custom-Header: Test


response body

Note, you doesn't have to write all headers, you should write only additional http headers, because blankd will automaticaly create all other standard http headers, there is one important rule: after headers you should write two line-breaks, if you want to send custom http status, then you must write it at the first line.

For your usability purposes blankd will create temporary directory for every request with following structure:

.
├── _id          # unique identifier (generated by **blankd**)
├── raw          # raw request
├── method       # request method in uppercase
├── host         # request host from Host: header
├── uri
│   ├── raw      # raw request URI
│   ├── path     # URI path without query
│   ├── query    # URI query without path
│   └── values   # URI form values in 'key=value' format
├── headers
│   ├── raw      # raw request headers
│   └── values   # request headers in 'key=value' format
├── cookies      # request cookies in 'key=value' format
└── body
    ├── raw      # raw request body
    └── values   # request form values in 'key=value' format

blankd will pass path to directory with request details as argument to specified program.

After running blankd you doesn't have to guess an answer to question like 'does it listening now?', because blankd will fork when starts listening for a http connections, output new process pid to stdout and exit with zero code.

Synopsis

	blankd [options] -l <address> -e <path>
	blankd -h | --help
	blankd --version

Options:
    -l <address>  Listen specified address.
    -e <path>     Run specified program on every request.
    -o <path>     Output logs to specified file. [default: blankd.log]
    -h --help     Show this screen.
    --version     Show version.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages