socket_server

Creates a server that receives messages over a (tcp/udp/unix) socket. Each connection is parsed as a continuous stream of line delimited messages.

# Common config fields, showing default values
input:
socket_server:
network: unix
address: /tmp/benthos.sock

If multipart is set to false each line of data is read as a separate message. If multipart is set to true each line is read as a message part, and an empty line indicates the end of a message.

If the delimiter field is left empty then line feed (\n) is used.

The field max_buffer specifies the maximum amount of memory to allocate per connection for buffering lines of data. If a line of data from a connection exceeds this value then the connection will be closed.

Fields

network

A network type to accept (unix|tcp|udp).

Type: string
Default: "unix"
Options: unix, tcp, udp.

address

The address to listen from.

Type: string
Default: "/tmp/benthos.sock"

# Examples
address: /tmp/benthos.sock
address: 0.0.0.0:6000

multipart

Whether messages should be consumed as multiple parts. If so, each line is consumed as a message parts and the full message ends with an empty line.

Type: bool
Default: false

max_buffer

The maximum message buffer size. Must exceed the largest message to be consumed.

Type: number
Default: 1000000

delimiter

The delimiter to use to detect the end of each message. If left empty line breaks are used.

Type: string
Default: ""