Proxy protocol

Integration level: params
Protocol stores raw data in channel messages and/or proxies raw data to target servers via TCP.
flespi parses the Proxy protocol messages into a JSON object with the fields listed below in the Parameters tab.
channel.id
number
ID of channel that received a message
ident
string
Device unique identificator and optional password
peer
string
IP:port from which device connecting to the channel
proxy.event
Channel event type: 0 - data received, 1 - connect, 2 - disconnect
proxy.payload.hex
Data received, in HEX format
proxy.payload.size
bytes
Size of data packet
proxy.source
Message source: 0 - channel incoming connection, 1 - target1, 2 - target2, etc
server.timestamp
number
seconds
Timestamp when server received a message
timestamp
number
seconds
Message timestamp

Protocol by Gurtam that proxies raw data to target servers (up to 3 destinations) via TCP and/or stores raw data in channel messages (read more in a dedicated article). Also, the proxy channel has a nice binary/text traffic viewer integrated into Toolbox.

Proxy mode

To enable the proxy mode add one or more targets. Targets may be optionally marked as mandatory.

For mandatory targets: if a connection fails, the channel throws an error and drops an input connection.

For non-mandatory targets: if a connection fails, the channel continues data transmission to other targets.

If 'proxy replies' option is enabled, the channel will transmit replies from the corresponding target to the channel's input connection.

Store mode

If enabled, raw data packets are saved in channel messages as the 'proxy.payload.hex' parameter. If the payload size exceeds 2MB, the parameter is not registered. If target replies are enabled, then target response packets are also saved as the 'proxy.payload.hex' parameter in channel messages.

If neither store mode nor proxy mode is enabled, the channel simply skips the data from the input connection.

Note: However, the channel will always save diagnostic messages about each connection opened/closed event.

The following parameters are registered in channel messages and may be used to diagnose channel issues:

peer — the channel's incoming connection ip:port.

proxy.event — the channel event:

  • 0 — data received (if store mode enabled, messages of this type will include data in 'proxy.payload.hex')
  • 1 — connection established
  • 2 — connection dropped

proxy.source — attributes a message to a particular connection:

  • 0 — event in the channel's incoming connection
  • 1 — event in target 1
  • 2 — event in target 2, etc.