The websocket server for Armstrong
- Redis
- Ruby 1.9+
- Install Gem
bundle install
- Start both websocket server and API server
rake apollo:start
- or just start websocket server
rake apollo:ws_server
- just start api server
rake apollo:api_server
open developmemnt tool and type javascript
- connect with websocket server
init_channel('apollo');
- send message
var data_hash = {channel: 'apollo', msg: 'call armstrong'};
ws.send(JSON.stringify(data_hash));
- Specify channel with parameter.
- Put data(JSON format) in body will send to client.
here is example:
- POST request
http://localhost:4567/armstrong_push?channel=apollo
- data in the body
{
"data": {
"msg": "rock and roll"
}
}