Skip to main content
Version: 1.3.0

HTTP

Push

Synopsis​

Creates an HTTP server that accepts messages via HTTP POST requests. Supports multiple authentication methods, TLS encryption, and customizable response handling.

Schema​

- id: <numeric>
name: <string>
description: <string>
type: http
tags: <string[]>
pipelines: <pipeline[]>
status: <boolean>
properties:
address: <string>
port: <numeric>
url: <string>
protocol: <string>
content_type: <string>
reuse: <boolean>
workers: <numeric>
response:
code: <numeric>
body: <string>
content_type: <string>
tls:
status: <boolean>
cert_name: <string>
key_name: <string>
authentication:
type: <string>
username: <string>
password: <string>
header:
key: <string>
value: <string>
hmac:
type: <string>
header: <string>
key: <string>
prefix: <string>
queue:
interval: <numeric>

Configuration​

The following fields are used to define the device:

Device​

FieldRequiredDefaultDescription
idYUnique identifier
nameYDevice name
descriptionN-Optional description
typeYMust be http
statusNtrueEnable/disable the device

Connection​

FieldRequiredDefaultDescription
protocolN"tcp"Transport protocol (must be tcp)
addressN"0.0.0.0"Listen address
portYListen port
urlN"/"URL path to listen on
content_typeN"application/json"Expected content type of incoming requests

Response​

FieldRequiredDefaultDescription
response.codeN200HTTP response status code
response.bodyN{"message":"success"}Response body content
response.content_typeN"application/json"Response content type

Authentication​

FieldRequiredDefaultDescription
authentication.typeN"none"Authentication type (basic, header, or hmac)
usernameYUsername for basic auth (required if type is basic)
passwordYPassword for basic auth (required if type is basic)
header.keyYHeader name for header auth (required if type is header)
header.valueYHeader value for header auth (required if type is header)
hmac.typeYHMAC algorithm (sha1, sha256, or sha512)
hmac.headerYHeader name for HMAC signature
hmac.keyYSecret key for HMAC calculation
hmac.prefixN-Optional prefix to strip from HMAC header value

TLS​

FieldRequiredDefaultDescription
tls.statusNfalseEnable TLS encryption
tls.cert_nameYTLS certificate file path (required if TLS enabled)
tls.key_nameYTLS private key file path (required if TLS enabled)
note

TLS certificate and key files must be placed in the service root directory.

Advanced Configuration​

To enhance performance and achieve better message handling, the following settings are used.

Performance​

FieldRequiredDefaultDescription
reuseNtrueEnable socket address reuse
workersN<dynamic>Number of worker processes when reuse is enabled

Messages​

FieldRequiredDefaultDescription
queue.intervalN1Queue processing interval in seconds

Examples​

The following are commonly used configuration types.

Basic​

The minimum required settings for a basic server are POST endpoint at /logs, a JSON content type, and a simple success response

Create a simple HTTP server...

devices:
- id: 1
name: basic_http
type: http
properties:
port: 8080
url: "/logs"
content_type: "application/json"
response:
code: 200
body: '{"status":"ok"}'

Authentication​

For authentication, define a username/password, and an environment variable for the password.

HTTP server with basic auth...

devices:
- id: 2
name: auth_http
type: http
properties:
port: 8080
url: "/api/logs"
authentication:
type: "basic"
username: "vmetric"
password: "P@ssw0rd"

API Keys​

To enable API key authentication, use a custom header-based authentication, a configurable header name and value, and an environment variable for secure key storage.

HTTP server with API key header auth...

devices:
- id: 3
name: apikey_http
type: http
properties:
port: 8080
url: "/api/v1/logs"
authentication:
type: "header"
header:
key: "X-API-Key"
value: "${API_KEY}"

HMAC​

For a secure HMAC authentication, use SHA-256 signature verification, a custom signature header, and optional signature prefix.

HTTP server with HMAC signature verification...

devices:
- id: 4
name: hmac_http
type: http
properties:
port: 8080
url: "/secure/logs"
authentication:
type: "hmac"
hmac:
type: "sha256"
header: "X-Signature"
key: "${HMAC_SECRET}"
prefix: "sha256="
warning

When using HMAC authentication, ensure that the client calculates the signature using the same algorithm and key.

Secure​

For a secure server, use TLS encryption, basic authentication, a custom response code, and secure credentials handling.

HTTPS server with TLS and authentication...

devices:
- id: 5
name: secure_http
type: http
properties:
port: 8443
url: "/api/ingest"
tls:
status: true
cert_name: "server.crt"
key_name: "server.key"
authentication:
type: "basic"
username: "ingest_user"
password: "${INGEST_PASSWORD}"
response:
code: 201
body: '{"status":"created"}'
content_type: "application/json"
warning

For production deployments, always use TLS encryption when authentication is enabled to protect credentials and tokens.