Push notifications for your desktop from an API
JavaScript
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.
bin
lib
test
tls
.gitignore
.jshintrc
Procfile
README.md
package.json

README.md

Wishlists

  • TLS would be nice.

TCP Protocol Definition

  1. Connect from client, send up API token
  2. Server sends challenge
  3. Client signs the challenge with API secret and sends it back
  4. This is the challenge HMAC'd with SHA512, base64 encoded
  5. Server sends pushes until client disconnects
  6. Pushes are also HMAC'd

Server setup

The server is in two pieces. First is an HTTP server which handles user accounts, frontend, and the API.

The second portion is the push server, which handles client auth and push delivery.

These two are connected by a redis queue or two.

Push Flow

  1. API Endpoint is hit
  2. Data is pushed into the delivery queue
  3. Push server pops it off, checks for valid clients
  4. If a client (or more) are found, ship it out.
  5. If a client is not found, push it into a failed queue/pile

Packet Format

[SHA256 HMAC][MSGPACK] 

msgpack Body

{
  "id": 12345,
  "title": "derp",
  "body": "",              // Optional
  "url": "",               // Optional
  "image_url": "",         // Optional
  "timestamp": 123456789
}