go-websocket-frames

module
v0.0.0-...-a378c20 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2014 License: MIT

README

go-websocket-frames

Build Status

A codec for websocket for exchanging multi-part binary messages.

Protocol

+-------------------------------------+
| LEN = number of frames (uint32, BE) |
+-------------------------------------+-----------------------+
| N = frame size (uint32, BE)         | frame (N bytes long)  |
+-------------------------------------+-----------------------+
| (LEN-1) frames follow               | ...                   |

Example

import "github.com/tchap/go-websocket-frames/frames"

// Sender
data := [][]byte{
	[]byte("first"),
	[]byte("second"),
	[]byte("third"),
	[]byte("fourth"),
	[]byte("fifth"),
}
frames.C.Send(conn, data)

// Receiver
var data [][]byte
frames.C.Receive(conn, &data)

Documentation

See the generated documentation at GoDoc.

License

MIT, see the LICENSE file.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL