A collection of examples showcasing the capabilities of Action Cable.
Live Stream Video (Or Image).
Chart Live Data.
You must have redis installed and running on the default port:6379 (or configure it in config/redis/cable.yml).
wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable
make
make install
brew install redis
-
Run
bundle install -j 4
-
Open up a separate terminal and run:
./bin/rails server
-
One more terminal to run redis server:
redis-server
-
One more terminal Run
bundle exec sidekiq
-
One more terminal Run
anycable
-
One more terminal Run
anycable-go --host=0.0.0.0 --port=28080 \ --path=/cable \ --rpc_host=0.0.0.0:50051 \ --redis_url=redis://localhost:6379/2 \ --redis_channel=__anycable__ \ --debug
NOTE: You can use anycable-go or anycable-erlang, I choiced: anycable-go, So install follow that: https://github.com/anycable/anycable-go
-
Visit
http://localhost:3000/
- Open two browsers with separate cookie spaces (like a regular session and an incognito session).
- Login as different people in each browser.
- Go to the same message.
- Now you can see video from webcam laptop stream to every member in this room.
- Open two browsers with separate cookie spaces (like a regular session and an incognito session).
- Login as different people in each browser.
- Click Chart with live data.
- Now you can see the chart stream to every member in this room.
- Find the way sending image via WebSocket (replace current POST).
- Upgrade Rails. (target is lasted 6)
- Upgrade Ruby. (target is 3)
- Add End to End encrypted.
##CUSTOM IS YOUR... You can custom it...