Skip to content

Latest commit

 

History

History
59 lines (43 loc) · 1.14 KB

README.md

File metadata and controls

59 lines (43 loc) · 1.14 KB

socket.io-go-emitter

Build Status

A Golang implementation of socket.io-emitter

This project uses redis. Make sure your environment has redis.

Install and development

To install in your golang project.

$ go get github.com/yosuke-furukawa/socket.io-go-emitter

Usage

Example:

  emitter, _ := SocketIO.NewEmitter(&SocketIO.EmitterOpts{
    Host:"localhost",
    Port:6379,
  })
  emitter.Emit("message", "I love you!!")

Broadcasting and other flags

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)