Linux command
httplab 命令
网络
复制后可按需替换文件名、目录或参数。
常用示例
Start httplab
httplab
Start on a specific port
httplab -p [8080]
Start with an initial response status and body
httplab -s [200] -b "[Hello, World]"
Start with an initial response delay
httplab -d [500]
Enable CORS
httplab --cors
Specify custom config path
httplab -c [path/to/.httplab]
说明
httplab is an interactive web server that lets you inspect incoming HTTP requests and forge responses in real time through a terminal UI. It runs a local HTTP server and displays each request's method, path, headers, and body, while allowing you to customize the response status code, headers, and body interactively. Pre-built responses can be saved and loaded from a .httplab configuration file. The tool is useful for API development, webhook testing, and debugging HTTP client behavior.
参数
- -p, --port _port_
- Port to bind to (default: 10080).
- -s, --status _code_
- Initial response status code (default: 200).
- -b, --body _string_
- Initial response body (default: "Hello, World").
- -d, --delay _ms_
- Initial response delay in milliseconds.
- -H, --headers _strings_
- Initial response headers (default: X-Server:HTTPLab).
- -a, --auto-update
- Auto-update response when fields change (default: true).
- --cors
- Enable CORS.
- --cors-display
- Display CORS requests (default: true).
- -c, --config _path_
- Custom config path.
- -v, --version
- Print version.
FAQ
What is the httplab command used for?
httplab is an interactive web server that lets you inspect incoming HTTP requests and forge responses in real time through a terminal UI. It runs a local HTTP server and displays each request's method, path, headers, and body, while allowing you to customize the response status code, headers, and body interactively. Pre-built responses can be saved and loaded from a .httplab configuration file. The tool is useful for API development, webhook testing, and debugging HTTP client behavior.
How do I run a basic httplab example?
Run `httplab` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -p, --port _port_ do in httplab?
Port to bind to (default: 10080).