Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maurodelazeri/socketio
minimal socketio .9 implementation for golang
https://github.com/maurodelazeri/socketio
go golang socket socketio
Last synced: about 1 month ago
JSON representation
minimal socketio .9 implementation for golang
- Host: GitHub
- URL: https://github.com/maurodelazeri/socketio
- Owner: maurodelazeri
- License: mit
- Created: 2018-03-20T13:25:21.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-03-20T13:26:11.000Z (over 6 years ago)
- Last Synced: 2024-08-03T23:28:23.651Z (4 months ago)
- Topics: go, golang, socket, socketio
- Language: Go
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-golang-repositories - socketio
README
# SocketIO .9
[![Build Status](https://travis-ci.org/h00kwurm/socketio.svg?branch=master)](https://travis-ci.org/h00kwurm/socketio)This is a super minimal implementation of my SocketIO needs. If you do find yourself wanting to use it, go right ahead. Be forewarned! It is really underdeveloped. Want to submit a pull request and help out others stuck in a shit mode of point-nine-age?
Yeah, I know there are [two](https://github.com/googollee/go-socket.io) [other](https://github.com/oguzbilgic/socketio) options for socketio. Both are backed by websockets provided by [code.google.com](https://code.google.com/p/go/). This is backed by [gorilla websockets](https://github.com/gorilla/websocket). Thank you [gorilla](https://github.com/gorilla).
If it wasn't clear by now, this only supports websockets. Maybe you're thinking to yourself, why socketio if it always uses just websockets. Because reasons. That's why.
## Example:
package main
import (
"fmt"
"github.com/h00kwurm/socketio"
)const remoteServer = "http://127.0.0.1:8088"
func onConnect(output chan socketio.Message) {
output <- socketio.CreateMessageEvent(`{"msg":"test message"}`)
}func main() {
socket := socketio.SocketIO{
OnConnect: onConnect,
}err := socketio.ConnectToSocket(remoteServer, &socket)
if err != nil {
fmt.Println(err)
return
}}