Giter VIP home page Giter VIP logo

silex-test's Introduction

Websockets, Ratchet, Redis pubsub test

This is a proof of concept HTML5 websocket app showing how ratchet and websockets can be used along with Redis' pubsub publish and subscribe.

You can use the form below to subscribe/unsubscribe to a channel. When you subscribe you also subscribe to the corresponding Redis channel. So if using the cli you connect to Redis and do a PUBLISH channel:jmoz foo, the message will be published from Redis to the websocket server then to the browser.

You can publish via websockets to the WS server which will then broadcast to connected clients. This does not touch Redis.

You can make an AJAX request to this app which will then use Redis and PUBLISH which will be picked up by the WS server and broadcast to clients. This is a way to demo the raw Redis pubsub without using the cli.

The following tech is used:

  • Ratchet - the core WAMP app that uses an event loop, handles websockets and subscribes to Redis.
  • Predis-async - the client library for Redis that implements the react event loop.
  • Silex - used as the framework and provides the AJAX endpoint to publish via Redis.
  • AutobahnJS - the JS library to implement websockets.

Source code is on github jmoz/silex-test. App is running at silex-test.jmoz.co.uk/pubsub.

Developed by James Morris. Blog. @jwmoz.

silex-test's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

silex-test's Issues

Pusher: Failed to bind the ZMQ: No such device or Invalid argument'

Great tutorials! I have managed to run pubsub server and create js-functions for webservice. Right now I need to have Pusher class also. I have tried this tutorial: http://socketo.me/docs/push

When I try to run pusher.php and try to bind('tcp://localhost:5555') I get this error "Failed to bind the ZMQ: No such device" or when trying to bind('tcp://127.0.0.1:5555') I get "Failed to bind the ZMQ: Invalid argument".

So do you have a clue whats going on? Is there something the matter with my TCP connections? I really am a newbie to network connections stuff..

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.