proxy

Protocol by Gurtam that proxies raw data to target servers via TCP and/or stores raw data in channel messages (read more in a dedicated article).

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 payload size exceeds 2MB, the parameter is not registered. If targets replies are enabled, then targets 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.

Below is the list of parameters that can appear in the messages received by the channel via proxy protocol. In most parameters, the name consists of tags split by dots: tag1.tag2.tag3.tag4... Each tag defines a certain area of an application, e.g. any parameter that contains mileage data has the 'mileage' tag in the name and any parameter related to fuel control contains the 'fuel' tag. By default JSON fields of the message received by a channel via this protocol can only contain the below-specified parameters. Any additional parameter will be prefixed by the "custom" tag, e.g. "custom.unspecified-name".

Name Type Unit Description
channel_id number ID of channel that received 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 message
timestamp number seconds Message timestamp
No results found.