跳到主要内容
版本:Next
input/httpINPUTBUFFERPROCESSOROUTPUT

HTTP

The HTTP input runs as an Axum HTTP server and accepts POST requests sent to address+path. The request body (JSON) is decoded and forwarded into the stream processing pipeline. Optional CORS and Basic/Bearer authentication are supported.

Configuration

FieldTypeRequiredDefaultDescription
typestringyesConstant value "http"
addressstringyesListen address, e.g. 0.0.0.0:8080
pathstringyesURL path that receives messages, e.g. /data
cors_enabledbooleannofalseWhether to enable CORS
authobjectnoAuthentication configuration, see table below

auth

auth is a tagged enum (distinguished by the type field) with two mutually exclusive forms:

FieldTypeRequiredDescription
typestringyes"basic" or "bearer"
usernamestringyes (basic)Basic auth username
passwordstringyes (basic)Basic auth password
tokenstringyes (bearer)Bearer token

Examples

input:
type: "http"
address: "0.0.0.0:8080"
path: "/data"
cors_enabled: true
input:
type: "http"
address: "0.0.0.0:8080"
path: "/data"
auth:
type: "basic"
username: "user"
password: "pass"
input:
type: "http"
address: "0.0.0.0:8080"
path: "/data"
auth:
type: "bearer"
token: "your-token"