Skip to content

Latest commit

 

History

History
46 lines (32 loc) · 1.26 KB

README.md

File metadata and controls

46 lines (32 loc) · 1.26 KB

engine.io-parser

workflow Coverage Status GoDoc License

This is the GO parser version 4 for the engine.io protocol encoding.

Installation

Use go get.

go get github.com/funcards/engine.io-parser/v4

Then import the parser package into your own code.

import "github.com/funcards/engine.io-parser/v4"

How to use

The parser can encode/decode packets, payloads and payloads as binary.

Example:

payload := eiop.Payload{
    {Type: eiop.Open},
    {Type: eiop.Close},
    {Type: eiop.Ping, Data: "probe"},
    {Type: eiop.Pong, Data: "probe"},
    {Type: eiop.Message, Data: "test"},
}
encoded := payload.Encode(&buf)
fmt.Println(encoded.(string))

payload1 = eiop.DecodePayload(encoded) // payload == payload1

License

Distributed under MIT License, please see license file within the code for more details.