aboutsummaryrefslogtreecommitdiff
path: root/plugins/framing_dynamic32.md
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2021-02-20 20:06:06 +0100
committercbdev <cb@cbcdn.com>2021-02-20 20:06:06 +0100
commit767f4980e54415c4680a4619c69b14f5b3ec24bb (patch)
treef04b5b25d2d7fd97b56dc76bb0ad5c2e9592df28 /plugins/framing_dynamic32.md
parentb88b306db792a76371e3c9eddabb6f45d8a7e534 (diff)
downloadwebsocksy-767f4980e54415c4680a4619c69b14f5b3ec24bb.tar.gz
websocksy-767f4980e54415c4680a4619c69b14f5b3ec24bb.tar.bz2
websocksy-767f4980e54415c4680a4619c69b14f5b3ec24bb.zip
Implement dynamic32 framing function
Diffstat (limited to 'plugins/framing_dynamic32.md')
-rw-r--r--plugins/framing_dynamic32.md21
1 files changed, 21 insertions, 0 deletions
diff --git a/plugins/framing_dynamic32.md b/plugins/framing_dynamic32.md
new file mode 100644
index 0000000..51ca04c
--- /dev/null
+++ b/plugins/framing_dynamic32.md
@@ -0,0 +1,21 @@
+# The `dynamic32` framing function
+
+The `dynamic32` peer stream framing function segments the peer stream into binary frames
+at dynamic byte boundaries inferred from the stream data itself. The function will read
+a 32bit length value at a specified offset from the stream and treat it as the length
+of the next segment to be framed.
+
+## Configuration
+
+The framing configuration string may be a comma-separated list of options of the form
+`<key>=<value>`, containing one or more of the following keys:
+
+* `offset`: Set the offset (in bytes) of the 32-bit segment size in the stream, counted from the start of a segment/stream (Default: `0`)
+* `static`: Static amount to add to the segment length, e.g. to account for fixed headers (Default: `0`)
+* `endian`: Set the byte order of the transmitteed size to either `big` or `little` (Default: `little`)
+
+The total size of the segment sent to the Websocket peer can be calculated using the formula
+
+```
+offset + 4 /*32bit size field*/ + static + size field content
+```