Make your API realtime.
go run examples/main.go
var websocket = new WebSocket("ws://localhost:8080");
websocket.send(JSON.stringify({event: "channel:subscribe", channel: '/courses/23423423'}));
websocket.send(JSON.stringify({event: "channel:unsubscribe", channel: '/courses/23423423'}));
websocket.send(JSON.stringify({event: "someEvent", channel: '/courses/23423423', data: {test: ''}}));
websocket.close()
- MsgPack for binary transport (make it configurable)
- Namespaced/seperate handlers
- Compress json format to single character keys
- Autobind on any REST action, unless explicitly disabled
- Optional TTL
- Side benefit of providing API CDN
- Security filters such as ip blacklisting/rate limiting
- Web Interface for configuring REST endpoints
- Libraries to integrate push into apps
- Clustering support
This is a work in progress...
{
id: 1,
event: "auth",
data: {
token: '7879a3aa5783ba49e89fb2ee3a27480c96c4e6ce'
}
}
{
id: 1,
status: 'ok',
data: {
expires: 1400382523
}
}
{
id: 1,
event: "bind",
uri: '/posts/1234'
}
{
id: 1,
status: 'ok'
}
{
event: "update",
uri: '/posts/1234',
data: {
...
}
}
{
id: 1,
event: "unbind",
uri: '/posts/1234'
}
{
id: 1,
status: 'ok'
}
{
id: 1,
event: "index",
uri: '/posts'
}
{
id: 1,
status: 'ok'
data: {
...
}
}
{
id: 1,
event: "show",
uri: '/posts/1234'
}
{
id: 1,
status: 'ok'
data: {
...
}
}
{
id: 1,
event: "create",
uri: '/posts',
data: {
title: 'Post title',
...
}
}
{
id: 1,
status: 'ok',
data: {
...
}
}
{
id: 1,
event: "update",
uri: '/posts/1234',
data: {
title: 'Post title',
...
}
}
{
id: 1,
status: 'ok'
}
{
id: 1,
event: "delete",
uri: '/posts/1234',
data: {
title: 'Post title',
...
}
}
{
id: 1,
status: 'ok'
}