Thunderpush

Tornado and SockJS based, complete Web push solution
Download

Thunderpush Ranking & Summary

Advertisement

  • Rating:
  • License:
  • BSD License
  • Price:
  • FREE
  • Publisher Name:
  • Krzysztof Jagiello
  • Publisher web site:
  • https://github.com/thunderpush/

Thunderpush Tags


Thunderpush Description

Thunderpush is a Tornado and SockJS based push service that provides a Beaconpush (beaconpush.com) inspired HTTP API and client.This project is in early stage of development and should not be used in production environments.Installpip install thunderpushUsageUsage: thunderpush apikey apisecretOptions: -h, --help show this help message and exit -p PORT, --port=PORT binds server to custom port -H HOST, --host=HOST binds server to custom address -v, --verbose verbose mode -d, --debug debug mode (useful for development)JavaScript clientIn order to use provided by Thunderpush client, you need to include following lines on your webpage.< script src="http://cdn.sockjs.org/sockjs-0.3.min.js" >< /script >< script src="thunderpush.js" >< /script >The only thing you have to do now is to make a connection to your Thunderpush server in following way:< script type="text/javascript" >Thunder.connect("thunder.example.com", "apikey", , {log: true});Thunder.listen(function(message) { alert(message); });< /script >This code is all you need to do to start receive messages pushed to the client from your Thunderpush server. As you can see, we instructed Thunder client to display logs, which can be helpful for debugging your application.For more examples of how to use Thunderpush, look into examples.Open-source libraries for communicating with the HTTP APIPython: python-thunderclientPHP: php-thunderclientUsing the HTTP APIExample of interacting with Thunderpush API using cURL:curl \ -X POST \ -H "Content-Type: application/json" \ -H "X-Thunder-Secret-Key: secretkey" \ --data-ascii "\"Hello World!\"" \ http://thunder.example.com/api/1.0.0//channel//All requests to the HTTP API must provide X-Thunder-Secret-Key header that should contain the private API key.Sending a message to a channelPOST /api/1.0.0//channels//Message should be sent as the body of the request. Only valid JSON body will be accepted.Getting number of users onlineGET /api/1.0.0//users/Checking presence of a userGET /api/1.0.0//users//Sending a message to a userPOST /api/1.0.0//users//Message should be sent as the body of the request. Only valid JSON body will be accepted.Forcing logout of a userDELETE /api/1.0.0//users//Always returns 204 http code.Retrieving list of users in a channelGET /api/1.0.0//channels//JavaScript client APIConnecting to the serverThunder.connect(server, apiKey, channels, options)Connects to the Thunderpush server and starts listening for incomming messages.server Adress of your Thunderpush server.apiKey Public api key.channels Array of channels you want to subscribe to.options Object with optional settings you may pass to Thunder: log Set it to true if you want to activate verbose mode. This will turn on SockJS logs as well. user Set it to override the client generated user id.Listening for messagesThunder.listen(handler)Registers callback function that will receive incomming messages. You can register as many handlers you want. Handler function should accept one argument which is the message itself.Product's homepage


Thunderpush Related Software