README.md 340 Bytes
Newer Older
Jeromy's avatar
Jeromy committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# go-multiplex

A super simple stream muxing library compatible with [multiplex](http://github.com/maxogden/multiplex)

## Usage

```go
mplex := multiplex.NewMultiplex(mysocket)

s := mplex.NewStream()
s.Write([]byte("Hello World!")
s.Close()

mplex.Serve(func(s *multiplex.Stream) {
	// echo back everything received
	io.Copy(s, s)
})
```