<commit_before># Engine.IO

[![Build Status](https://travis-ci.org/jjeffcaii/engine.io.svg?branch=master)](https://travis-ci.org/jjeffcaii/engine.io)

Unofficial server-side [Engine.IO](https://github.com/socketio/engine.io) in Golang.

## Example

``` golang
package main

import (
	"flag"
	"log"

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

func main() {
	flag.Parse()
	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

| Key | Compatible | Remarks |
|------|-----|------|
| polling-xhr | Yes | |
| polling-jsonp | Yes | |
| websocket | Yes | |
| upgrade | Yes | |


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

## Benchmarks

TODO<commit_msg>fix readme<commit_after># Engine.IO

[![Build Status](https://travis-ci.org/jjeffcaii/engine.io.svg?branch=master)](https://travis-ci.org/jjeffcaii/engine.io)

Unofficial server-side [Engine.IO](https://github.com/socketio/engine.io) in Golang.

## Example

``` golang
package main

import (
	"flag"
	"log"

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

func main() {
	flag.Parse()
	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

| Key | Compatible | Remarks |
|------|-----|------|
| polling-xhr | Yes | |
| polling-jsonp | Yes | |
| websocket | Yes | |
| upgrade | Yes | |


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

## Documents

Please see [https://godoc.org/github.com/jjeffcaii/engine.io](https://godoc.org/github.com/jjeffcaii/engine.io).

## Benchmarks

TODO
{'fraction_non_alphanumeric': 0.2025378233284529, 'fraction_numerical': 0.006832601268911664, 'mean_word_length': 3.9043062200956937, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '277636', 'n_tokens_mistral': 839, 'n_tokens_neox': 799, 'n_words': 116}