一个带有用于测试 HTTP 客户端的 API 的 HTTP 服务器。受 httpbin 的启发,但不是其克隆。
Httpbun
This is an HTTP service with endpoints that are useful when testing any HTTP client, like a browser, a library, or any API developer tool. It's inspired by httpbin, but is so much more today.
Hosted at httpbun.com. Run your own with:
docker run -p 80:80 sharat87/httpbunTo override the external redirect allowlist used by endpoints like /redirect-to, set
HTTPBUN_ALLOWED_REDIRECT_DOMAINS to a comma- or whitespace-separated list such as
example.com, httpbun.com, *.github.io.
A project by Shri.
:warning: If you are using this from your CI, please don't. Run a local version using the above Docker command, within your CI system, and use that "locally".
There's a Taskfile.dist.yml included in the project, which is a Taskfile. Once you have task installed, running task run will start a local server from source. There's also:
task build to build the binarytask test to run teststask fmt to format code using a pinned, repo-local goimportstask docker to build binaries for building Docker imageWe patch Go's standard lib a little. There's a line in net/http/server.go that delets the Host header in all incoming requests. We comment that line out during build, and uncomment it again to restore it.
So, if you're using the same Go installation for this and other projects at the same time, you may see unexpected behaviour.
The patching and unpatching is in task patch and task unpatch targets.
Bug fixes, yes. New features, less so please. Either way, consider opening an issue to discuss it before you start working. This will ensure we are on the same page and your work would be in the right place to be merged in. It'll also ensure we don't end up working on the same thing, duplicating efforts. Thanks!
New features are added mostly as I need them, and in the form that I want to use them.
Apache-2.0 License. Project includes a NOTICE file.
暂无开放 Issues,或尚未同步最近议题。