aboutsummaryrefslogtreecommitdiff
path: root/plugins/framing_json.md
blob: c5a7e0957a7486f0f522d2167fe0008f57f69c8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# The `json` framing function

The `json` framing function segments the peer stream at boundaries defined by complete JSON
entities (Objects, Arrays, Strings or Values) and forwards these as text frames.

For example, on encountering the start of a JSON object at the beginning of the stream, it will read from the
peer until that objects closing brace and the send the entire object as a single text frame.

The plugin does not implement a full parser and performs only rudimentary syntactic analysis to determine
the end of the current entity. When encountering an error, the entire buffer is forwarded as a binary frame.
It is possible to construct erroneous JSON objects that pass the parser without an error, however any
syntactically correct object should be forwarded correctly (please file a bug with an example otherwise).

## Configuration

The `json` framing function does not require any configuration.