Skip to content

Commit 32199e0

Browse files
authored
Update README.md
1 parent ab5d375 commit 32199e0

1 file changed

Lines changed: 27 additions & 6 deletions

File tree

README.md

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
11
WebSocket frame parser and builder
2-
==================================
2+
----------------------------------
33

44
This 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.
1729
Inspired by [http-parser](https://github.com/joyent/http-parser) by [Ryan Dahl](https://github.com/ry)
1830
and [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

2240
This 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) {
94112
free(parser);
95113
```
96114

97-
### Frame builder
115+
Frame builder
116+
-------------
98117

99118
Calculate required memory for frame using `websocket_calc_frame_size` function
100119

@@ -115,15 +134,17 @@ and send binary string
115134
write(sock, frame, frame_len);
116135
```
117136

118-
### UID
137+
UUID
138+
----
119139

120140
Macro 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

0 commit comments

Comments
 (0)