Socket.io client api for Go
Go
Pull request Compare This branch is even with oguzbilgic:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.travis.yml
LICENSE
README.md
endpoint.go
endpoint_test.go
message.go
message_test.go
session.go
socket.go
socket_test.go
transport.go
url_parser.go
url_parser_test.go

README.md

Socket.IO Build Status

Package socketio implements a client for SocketIO protocol in Go language as specified in socket.io-spec

Usage

package main

import (
    "fmt"
    "github.com/oguzbilgic/socketio"
)

func main() {
    // Open a new client connection to the given socket.io server
    // Connect to the given channel on the socket.io server
    socket, err := socketio.DialAndConnect("socketio-server.com:80", "/channel", "key=value")
    if err != nil {
        panic(err)
    }

    for {
        // Receive socketio.Message from the server
        msg, err := socket.Receive()
        if err != nil {
            panic(err)
        }

        fmt.Printf("Type: %v, ID: '%s', Endpoint: '%s', Data: '%s' \n", msg.Type, msg.ID, msg.Endpoint, msg.Data)
    }
}

Documentation

http://godoc.org/github.com/oguzbilgic/socketio

License

The MIT License (MIT)