Skip to main content
Version: 3.3.0

http-server

Run HTTP server

Example

action:

http-server:
address: http://httpbin.org/get

Field NameDescriptionTypeDefault
addressBind addressstring-
pathUrl path on which to accept queriesstring/
content-typeContent type to return with responsestring-
certPath to the TLS certificate to be used (TLS requires both cert and key to be valid)path-
keyPath to the TLS private to be used (TLS requires both cert and key to be valid)path-
bodyAllows specifying exactly what is returnedtemplated text-

address

Bind address

Type: string

Example

action:

http-server:
address: 127.0.0.1:8000

path

Url path on which to accept queries

Type: string

Example

action:

http-server:
address: 127.0.0.1:8000
path: /foo/bar

content-type

Content type to return with response

Type: string

Example

action:

http-server:
address: 127.0.0.1:8000
content-type: application/text
body: some text

cert

Path to the TLS certificate to be used (TLS requires both cert and key to be valid)

Type: path

Example

action:

http-server:
address: 0.0.0.0:8000
cert: /etc/letsencrypt/live/dist.panoptix.io/fullchain.pem
key: /etc/letsencrypt/live/dist.panoptix.io/privkey.pem

key

Path to the TLS private to be used (TLS requires both cert and key to be valid)

Type: path

body

Allows specifying exactly what is returned

When not specified, the body returned is the whole event. May contain event field expansions.

Type: templated text

Example

action:

http-server:
body: '${_raw}'
address: 127.0.0.1:8000