Light and simple Comet (web-push) server on Golang
Go JavaScript HTML Python
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
.goreleaser.yml
.travis.yml
LICENSE
README.md
conn.go
main.go
pub.go
pusher.js
pusher.py
sub.go
test.html

README.md

Simple websocket push server

Build Status download binaries

This is a simple push server by Websocket in Go (uses "github.com/gorilla/websocket")

usage:

sub - ws://127.0.0.1:8095/sub - send {"op": "sub", "intent": "channelname.taskname.12345"} // or "unsub"

pub - http://127.0.0.1:8095/pub?intent=channelname.taskname.12345?obj={"id":123} // can send in post/get

server will sent {"op": "intent", "intent": "channelname.taskname.12345", "obj": "{\"id\":123}"}

You can use pusher.js on page:

// subscribe
pushSub(intent, function(obj){}); // intent - string, obj - additional data from server

// unsubscribe
pushUnsub(intent);

Also you can use pusher from python/django apps. See pusher.py module (use requests).

Use:

from pusher import push_intent

  push_intent(intent, obj) # obj - string or dict

To change listen port: add param -addr=8080