aboutsummaryrefslogtreecommitdiff
path: root/plugins/framing_json.md
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2019-06-22 18:10:03 +0200
committercbdev <cb@cbcdn.com>2019-06-22 18:10:03 +0200
commitfadc42453aca482a9db4f5c92adf58d43d87cdc7 (patch)
tree3ad8cb3e0461eef1a258998aab4100960493bf6b /plugins/framing_json.md
parente80367b0535a1800d0f95078d77ae735528e2523 (diff)
downloadwebsocksy-fadc42453aca482a9db4f5c92adf58d43d87cdc7.tar.gz
websocksy-fadc42453aca482a9db4f5c92adf58d43d87cdc7.tar.bz2
websocksy-fadc42453aca482a9db4f5c92adf58d43d87cdc7.zip
Implement JSON framing function (Fixes #2)
Diffstat (limited to 'plugins/framing_json.md')
-rw-r--r--plugins/framing_json.md16
1 files changed, 16 insertions, 0 deletions
diff --git a/plugins/framing_json.md b/plugins/framing_json.md
new file mode 100644
index 0000000..c5a7e09
--- /dev/null
+++ b/plugins/framing_json.md
@@ -0,0 +1,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.