File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11WebSocket frame parser and builder
2- ==================================
2+ ----------------------------------
33
44This is a parser and builder for WebSocket messages (see [ RFC6455] ( https://tools.ietf.org/html/rfc6455 ) ) written in C.
55
6- ### Features
6+ Table of Contents
7+ -----------------
8+
9+ * [ Features] ( #features )
10+ * [ Status] ( #status )
11+ * [ Usage] ( #usage )
12+ * [ Frame builder] ( #frame-builder )
13+ * [ UUID] ( #uuid )
14+ * [ Test frame] ( #test-frame )
15+
16+ Features
17+ --------
18+
719* Fast parsing and building of websocket messages
820* No dependencies
921* No internal buffering
@@ -17,7 +29,13 @@ Tested as part of [PHP-ION](https://github.com/php-ion/php-ion) extension.
1729Inspired by [ http-parser] ( https://github.com/joyent/http-parser ) by [ Ryan Dahl] ( https://github.com/ry )
1830and [ multipart-parser] ( https://github.com/iafonov/multipart-parser-c ) by [ Igor Afonov] ( https://github.com/iafonov ) .
1931
20- ### Usage
32+ Status
33+ ------
34+
35+ Production ready.
36+
37+ Usage
38+ -----
2139
2240This parser library works with several callbacks, which the user may set up at application initialization time.
2341
@@ -94,7 +112,8 @@ if(nread != data_len) {
94112free(parser);
95113```
96114
97- ### Frame builder
115+ Frame builder
116+ -------------
98117
99118Calculate required memory for frame using ` websocket_calc_frame_size ` function
100119
@@ -115,15 +134,17 @@ and send binary string
115134write(sock, frame, frame_len);
116135```
117136
118- ### UID
137+ UUID
138+ ----
119139
120140Macro WEBSOCKET_UUID contains unique ID for handshake
121141
122142``` c
123143#define WEBSOCKET_UUID "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"
124144```
125145
126- ### Test frame
146+ Test frame
147+ ----------
127148
128149* Raw frame: `\x81\x8Amask\x0B\x13\x12\x06\x08\x41\x17\x0A\x19\x00`
129150* Has mask: yes
You can’t perform that action at this time.
0 commit comments