Skip to content

funcards/socket.io-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

socket.io-parser

workflow Coverage Status GoDoc License

socket.io encoder and decoder written in GO complying with version 5 of socket.io-protocol.

TODO: reconstruct binary on decode

Installation

Use go get.

go get github.com/funcards/socket.io-parser/v5

Then import the parser package into your own code.

import "github.com/funcards/socket.io-parser/v5"

How to use

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

Example:

packet := siop.Packet{
    Type: siop.Connect,
    Nsp:  "/posts",
    Data: map[string]string{
        "sid": "unique-id",
    },
}
encoded := packet.Encode()
fmt.Println(encoded[0].(string))

fn := func(pkt Packet) {
    fmt.Println(pkt)
}

err := siop.Decode(fn, encoded...)

License

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

About

Parser for the socket.io protocol, used by server

Resources

License

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages