socket_server
Creates a server that receives a stream of messages over a TCP, UDP or Unix socket.
inputs:
label: ""
socket_server:
network: "" # No default (required)
address: "" # No default (required)
address_cache: "" # No default (optional)
tls:
cert_file: "" # No default (optional)
key_file: "" # No default (optional)
self_signed: false
client_auth: no
auto_replay_nacks: true
scanner:
lines: {}
Fields
address
The address to listen from.
Type: string
# Examples:
address: /tmp/benthos.sock
# ---
address: 0.0.0.0:6000
address_cache
An optional cache within which this input should write it’s bound address once known. The key of the cache item containing the address will be the label of the component suffixed with _address (e.g. foo_address), or socket_server_address when a label has not been provided. This is useful in situations where the address is dynamically allocated by the server (127.0.0.1:0) and you want to store the allocated address somewhere for reference by other systems and components.
Requires version 4.25.0 or later.
Type: string
auto_replay_nacks
Whether messages that are rejected (nacked) at the output level should be automatically replayed indefinitely, eventually resulting in back pressure if the cause of the rejections is persistent. If set to false these messages will instead be deleted. Disabling auto replays can greatly improve memory efficiency of high throughput streams as the original shape of the data can be discarded immediately upon consumption and mutation.
Type: bool
Default: true
scanner
The scanner by which the stream of bytes consumed will be broken out into individual messages. Scanners are useful for processing large sources of data without holding the entirety of it within memory. For example, the csv scanner allows you to process individual CSV rows without loading the entire CSV file in memory at once.
Requires version 4.25.0 or later.
Type: scanner
Default:
lines: {}
tcp.reuse_addr
Enable SO_REUSEADDR, allowing binding to ports in TIME_WAIT state. Useful for graceful restarts and config reloads where the server needs to rebind to the same port immediately after shutdown.
Type: bool
Default: false
tcp.reuse_port
Enable SO_REUSEPORT, allowing multiple sockets to bind to the same port for load balancing across multiple processes/threads.
Type: bool
Default: false
tls.client_auth
Specifies how client authentication is handled when using TLS.
Requires version 4.44.1 or later.
Type: string
Default: no
| Option | Summary |
|---|---|
|
client certificate is not requested nor required. |
|
will request client certificate, not require it. |
|
will accept any client certificate, even if not valid. |
|
requires a valid client certificate. |
|
will verify a certificate, if one is sent by the client. |