Skip to content

mtomsu/socket.io-go-emitter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

socket.io-go-emitter

Build Status

A Golang implementation of socket.io-emitter

This project was forked to make the Redis PUBLISH channel compatible with the Node.js implementation of the Socket.IO Redis adapter: socket.io-redis.

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)

Packages

No packages published

Languages

  • Go 92.9%
  • JavaScript 7.1%