Categorygithub.com/jjeffcaii/engine.io
modulepackage
0.9.0
Repository: https://github.com/jjeffcaii/engine.io.git
Documentation: pkg.go.dev

# README

Engine.IO

Build Status

Unofficial server-side Engine.IO in Golang.

Example

package main

import (
	"log"

	"github.com/jjeffcaii/engine.io"
)

func main() {
	server := eio.NewEngineBuilder().Build()
	server.OnConnect(func(socket eio.Socket) {
		socket.OnMessage(func(data []byte) {
			log.Println("recieve:", string(data))
		})
		socket.OnClose(func(reason string) {
			log.Println("socket closed:", socket.ID())
		})
		socket.Send("你好,世界!")
	})
	log.Fatalln(server.Listen(":3000"))
}

Compatibility

KeyCompatibleRemarks
polling-xhrYes
polling-jsonpYes
websocketYes
upgradeYes

NOTICE: all compatibility tests are under engine.io-client^3.1.2

Documents

Please see https://godoc.org/github.com/jjeffcaii/engine.io.

Benchmarks

TODO

# Packages

No description provided by the author

# Functions

NewEngineBuilder create a builder for Engine.

# Constants

POLLING use Polling-XHR as Transport.
WEBSOCKET use Websocket as Transport.

# Variables

DefaultPath for engine.io http router.

# Structs

EngineBuilder is a builder for Engine.

# Interfaces

Engine is the main server/manager.
Socket is a representation of a client.
Transport is used to control socket.

# Type aliases

TransportType define the type of transport.