All Projects → edgurgel → Poxa

edgurgel / Poxa

Licence: mit
Pusher server implementation compatible with Pusher client libraries.

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to Poxa

Beaver
💨 A real time messaging system to build a scalable in-app notifications, multiplayer games, chat apps in web and mobile apps.
Stars: ✭ 1,056 (+17.59%)
Mutual labels:  pubsub, pusher, websocket
Deepstream.io
deepstream.io server
Stars: ✭ 6,947 (+673.61%)
Mutual labels:  pubsub, websocket
Gateway
🚀构建分布式即时聊天、消息推送系统。 Building distributed instant messaging, push notification systems.
Stars: ✭ 188 (-79.06%)
Mutual labels:  pusher, websocket
Autobahn Js
WAMP in JavaScript for Browsers and NodeJS
Stars: ✭ 1,345 (+49.78%)
Mutual labels:  pubsub, websocket
Wampsharp
A C# implementation of WAMP (The Web Application Messaging Protocol)
Stars: ✭ 355 (-60.47%)
Mutual labels:  pubsub, websocket
Autobahn Java
WebSocket & WAMP in Java for Android and Java 8
Stars: ✭ 1,467 (+63.36%)
Mutual labels:  pubsub, websocket
Chat Engine
Object oriented event emitter based framework for building chat applications in Javascript.
Stars: ✭ 87 (-90.31%)
Mutual labels:  pubsub, websocket
Wsify
Just a tiny, simple and real-time self-hosted pub/sub messaging service
Stars: ✭ 452 (-49.67%)
Mutual labels:  pubsub, pusher
Autobahn Python
WebSocket and WAMP in Python for Twisted and asyncio
Stars: ✭ 2,305 (+156.68%)
Mutual labels:  pubsub, websocket
Wampy
Websocket RPC and Pub/Sub for Python applications and microservices
Stars: ✭ 115 (-87.19%)
Mutual labels:  pubsub, websocket
Centrifuge
Real-time messaging library for Go with scalability in mind
Stars: ✭ 446 (-50.33%)
Mutual labels:  pubsub, websocket
Centrifugo
Scalable real-time messaging server in a language-agnostic way. Set up once and forever.
Stars: ✭ 5,649 (+529.06%)
Mutual labels:  websocket, pubsub
Springboot Learning
🚕 spring boot学习案例,方便spring boot 初学者快速掌握相关知识
Stars: ✭ 724 (-19.38%)
Mutual labels:  websocket
Netcoreserver
Ultra fast and low latency asynchronous socket server & client C# .NET Core library with support TCP, SSL, UDP, HTTP, HTTPS, WebSocket protocols and 10K connections problem solution
Stars: ✭ 799 (-11.02%)
Mutual labels:  websocket
Iodine
iodine - HTTP / WebSockets Server for Ruby with Pub/Sub support
Stars: ✭ 720 (-19.82%)
Mutual labels:  pubsub
Briefing
Secure direct video group chat
Stars: ✭ 710 (-20.94%)
Mutual labels:  websocket
Glowing Bear
A web client for WeeChat
Stars: ✭ 830 (-7.57%)
Mutual labels:  websocket
Cowboy
Small, fast, modern HTTP server for Erlang/OTP.
Stars: ✭ 6,533 (+627.51%)
Mutual labels:  websocket
Gun
HTTP/1.1, HTTP/2 and Websocket client for Erlang/OTP.
Stars: ✭ 710 (-20.94%)
Mutual labels:  websocket
Qbit
The Java microservice lib. QBit is a reactive programming lib for building microservices - JSON, HTTP, WebSocket, and REST. QBit uses reactive programming to build elastic REST, and WebSockets based cloud friendly, web services. SOA evolved for mobile and cloud. ServiceDiscovery, Health, reactive StatService, events, Java idiomatic reactive programming for Microservices.
Stars: ✭ 702 (-21.83%)
Mutual labels:  websocket

Build Status Inline docs Release Docker

Poxa

Open Pusher implementation compatible with Pusher libraries. It's designed to be used as a single registered app with id, secret and key defined on start.

How do I speak 'poxa'?

['poʃa] - Phonetic notation

[posha] : po ( potion ), sha ( shall )

Features

  • Public channels;
  • Private channels;
  • Presence channels;
  • Client events;
  • SSL on websocket and REST API;
  • Simple console;
  • REST API
    • /users on presence channels
    • /channels/:channel_name
    • /channels

Development

Poxa is a standalone elixir server implementation of the Pusher protocol.

You need Elixir 1.9 at least and Erlang 21.0

Clone this repository

Run

mix deps.get
mix compile

The default configuration is:

  • Port: 8080
  • App id: 'app_id'
  • App key: 'app_key'
  • App secret: 'secret'

Using Docker

Docker images are automatically built by Docker Hub. They are available at Docker Hub: https://hub.docker.com/r/edgurgel/poxa-automated/tags/

One can generate it using: docker build -t local/poxa ..

The docker run command should look like this:

docker run --rm --name poxa -p 8080:8080 edgurgel/poxa-automated:latest

Configuration

The following environment variables are supported:

  • PORT
  • POXA_APP_KEY
  • POXA_SECRET
  • POXA_APP_ID
  • POXA_REGISTRY_ADAPTER
  • WEB_HOOK
  • ACTIVITY_TIMEOUT
  • POXA_SSL
  • SSL_PORT
  • SSL_CACERTFILE
  • SSL_CERTFILE
  • SSL_KEYFILE

Your application

If you are using the pusher-gem:

Pusher.host   = 'localhost'
Pusher.port   = 8080

And pusher-js:

// will only use WebSockets
var pusher = new Pusher(APP_KEY, {
  wsHost: 'localhost',
  wsPort: 8080,
  enabledTransports: ["ws", "flash"],
  disabledTransports: ["flash"]
});

A working poxa is on http://poxa.herokuapp.com, with:

  • App key: "app_key"
  • App id: "app_id"
  • App secret: "secret"
  • Port: 80

Also a pusher example(https://github.com/pusher/pusher-presence-demo) is running using poxa at: http://poxa-presence-chat.herokuapp.com/

Console

A simple console is available on index:

Console

You can see it in action on http://poxa.herokuapp.com using "app_key" and "secret" to connect. Now open the poxa-presence-chat and watch events happening!

Implementation

Poxa uses gproc extensively to register websocket connections as channels. So, when a client subscribes for channel 'example-channel', the websocket connection (which is a elixir process) is "tagged" as {pusher, example-channel}. When a pusher event is triggered on the 'example-channel', every websocket matching the tag receives the event.

Contributing

If you'd like to hack on Poxa, start by forking my repo on Github.

Dependencies can be fetched running:

MIX_ENV=dev mix deps.get

Compile:

mix compile

The test suite used is the ExUnit and Mimic to mock stuff.

To run tests:

mix test

Pull requests are greatly appreciated.

TODO

  • [ ] SockJS support;
  • [x] Complete REST api;
  • [x] Mimic pusher error codes;
  • [x] Integration test using pusher-js or other client library;
  • [x] Web hooks;
  • [x] Add 'Vacated' and 'Occupied' events to Console;
  • [X] Use gproc to generate Console events so other handlers can be attached (Web hook for example);
  • [ ] Turn Poxa on a distributed server with multiple nodes;

Pusher

Pusher is an excellent service and you should use it in production.

Acknowledgements

Thanks to @bastos for the project name ❤️!

Who is using it?

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].