A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pusher/pusher-channels-auth-example below:

pusher/pusher-channels-auth-example: A simple server exposing a pusher auth endpoint

Pusher Channels Example Auth Server

This project aims to demonstrate how to implement a Pusher authorization endpoint using the pusher-http-node library. There's no concept of users - a valid token is provided to every request - so this shouldn't be used in production.

BEFORE you run this project you'll need an appId, appKey, appSecret and cluster for Pusher. You can get these from the keys tab of your pusher dashboard

You'll need to insert your appId, appKey, appSecret and cluster when deploying your app.

Make a copy of the .env.example file.

Add your appId, appKey, appSecret and cluster to the newly created .env file.

When you have a .env file containing a valid APP_ID APP_KEY, APP_SECRET and CLUSTER you're ready to run.

That's it. You can test everything works by sending a POST request to http://localhost:3030/pusher/auth

curl -X POST http://localhost:3030/pusher/auth \
  -H "Content-Type: application/json" \
  -d '{"socket_id": "100.100", "channel_name": "private-document"}'

To test E2E encryption, generate a random 32 byte master key, base64 encode it and add it to your .env as ENCRYPTION_MASTER_KEY, then use a channel with an encrypted name prefix, e.g.

curl -X POST http://localhost:3030/pusher/auth \
  -H "Content-Type: application/json" \
  -d '{"socket_id": "100.100", "channel_name": "private-encrypted-document"}'

The response should contain an additional shared_secret key and value.

A suitable key can be generated like this:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4