A Golang implementation of socket.io-emitter
This project uses redis. Make sure your environment has redis.
To install in your golang project.
$ go get github.com/yosuke-furukawa/socket.io-go-emitter
Example:
emitter, _ := SocketIO.NewEmitter(&SocketIO.EmitterOpts{
Host:"localhost",
Port:6379,
})
emitter.Emit("message", "I love you!!")
Possible flags
- json
- volatile
- broadcast
emitter, _ := SocketIO.NewEmitter(&SocketIO.EmitterOpts{
Host:"localhost",
Port:6379,
})
emitter.Volatile().Emit("message", "I love you!!")
** Binary Support
emitter, _ := SocketIO.NewEmitter(&SocketIO.EmitterOpts{
Host:"localhost",
Port:6379,
})
val := bytes.NewBufferString("I love you!!")
emitter.EmitBinary("message", val)