Skip to content

Implementation of custom frame connection with frame structure similar to websoket, but with appended preambule in the start of the frame.

License

Notifications You must be signed in to change notification settings

sazonovItas/go-tcpws

Repository files navigation

Tcp framing connection

Implementation of custom frame connection with frame structure similar to websoket, but with appended preambule in the start of the frame.

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+---------------+---------------+---------------+---------------+
|      0x5A     |      0xA5     |      0x5A     |      0xA5     |
+-+-+-+-+-------+-+-------------+---------------+---------------+
|F|R|R|R| opcode|M| Payload len |    Extended payload length    |
|I|S|S|S|  (4)  |A|     (7)     |             (16/64)           |
|N|V|V|V|       |S|             |   (if payload len==126/127)   |
| |1|2|3|       |K|             |                               |
+-+-+-+-+-------+-+-------------+ - - - - - - - - - - - - - - - +
|     Extended payload length continued, if payload len == 127  |
+ - - - - - - - - - - - - - - - +-------------------------------+
|                               |Masking-key, if MASK set to 1  |
+-------------------------------+-------------------------------+
| Masking-key (continued)       |          Payload Data         |
+-------------------------------- - - - - - - - - - - - - - - - +
:                     Payload Data continued ...                :
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
|                     Payload Data continued ...                |
+---------------------------------------------------------------+

About

Implementation of custom frame connection with frame structure similar to websoket, but with appended preambule in the start of the frame.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published