Questions tagged [actioncable]

Action Cable is an open source technology shipped to us with Ruby On Rails 5. It uses websockets instead of traditional HTTP protocol and allows 2-way asynchronious data transfer. The best field of application for ActionCable is chat, single page applications and so on.

The Action Cable source is placed at Github.

To find code examples please check actioncable-examples repository.

849 questions
9
votes
1 answer

ActionCable on subdomain instead of subdir

I am trying to get ActionCable work on a subdomain. the problem is that as soon as I am changing the following line config.action_cable.mount_path = '/' The app isn't working anymore. But ActionCable works on a subdomain. Is there any solution to…
DjangoSi
  • 395
  • 2
  • 4
  • 16
9
votes
1 answer

Configuration for action cable for postgreSQL?

How will the configuration file, config/cable.yml look like for a postgreSQL adapter?
Vedant Agarwala
  • 18,146
  • 4
  • 66
  • 89
9
votes
1 answer

Action Cable and Ionic

I have a Rails Application in production environment and now I need to develop a Mobile App as a "frontend" for the same system. We are already building an API, but many users will be able to change data at the same time, therefore, would be nice…
gcstr
  • 1,466
  • 1
  • 21
  • 45
9
votes
2 answers

Capybara not working with action_cable

I'm using the Rails 5 beta 3 with action cable, the integration works fine in development but when I try to run a feature test through capybara, it doesn't seem to hit the channel actions. I'm using Portergeist and configured puma as capybara's…
9
votes
4 answers

application and actioncable won't share cookie

I am using devise for authentication, but when I implemented your method I got "An unauthorized connection attempt was rejected" After hours of searching I found out that: cookies.signed['user.id'] returns nil. In the following code block. def…
Bas de Ruiter
  • 101
  • 1
  • 7
9
votes
1 answer

How does broadcasting from a Phoenix Channel hit clients on other nodes?

I'm trying to compare Phoenix Channels with the new Rails ActionCable when it comes to working with WebSockets. For some context, ActionCable uses Redis to handle PubSub when broadcasting a message to all clients. Example scenario: 1 of 3 rails…
dimroc
  • 1,172
  • 1
  • 16
  • 26
8
votes
0 answers

ActionCable: How to check if user is subscribed to channel?

Situation: I have a small chat app with two users in each room. Lets call'em Sender and Receiver. I'd like to make 'read/unread messages'. To determine if Sender's message is currently being read he needs to know if Receiver is currently subscribed…
Alexander Gorg
  • 1,049
  • 16
  • 32
8
votes
2 answers

Does Action Cable 5 require Redis?

I use: rails (5.0.2) actioncable (5.0.2) puma (3.8.2) I have a Rails 5 Action Cable demo chat and a year ago it didn't work without Redis - and now it does! (after bundle update). In other words, I succedeed to make my demo chat to work in…
prograils
  • 2,248
  • 1
  • 28
  • 45
8
votes
1 answer

Is Action Cable the same thing as Faye?

Implementing Web Sockets in my app I've become confused which gem is better. I found plenty of different opportunities, however, some are hard to distinct. Finally, I've chosen Action Cable (a Rails 5 native part) and Faye (appeared earlier and…
Alexander Gorg
  • 1,049
  • 16
  • 32
8
votes
2 answers

ActionCable - failed to upgrade to WebSocket

I have an issue with connection to web socket. There is an error: Successfully upgraded to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: websocket) User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" IS…
Prezes Łukasz
  • 938
  • 1
  • 9
  • 30
8
votes
2 answers

How to change ping interval in action cable rails

I'm using ActionCable and receiving pings from server after each 3 seconds interval (mentioned in the ActionCable library). My question is: How can I change the ping interval at the time of subscription? Any idea?
faisal bhatti
  • 325
  • 2
  • 12
8
votes
3 answers

How do you remove an actioncable channel subscription in Rails 5 with App.cable.subscriptions.remove?

To create subscriptions I run: App.room = App.cable.subscriptions.create({ channel: "RoomChannel", roomId: roomId }, { connected: function() {}, disconnected: function() {}, received: function(data) { return…
Laser
  • 5,085
  • 4
  • 34
  • 48
8
votes
3 answers

RoR 5.0.0 ActionCable wss WebSocket handshake: Unexpected response code: 301

Hello I'm trying to serve a simple chat using ror 5.0.0 beta (with puma) working on production mode (in localhost there are no problems). This is my Nginx configuration: upstream websocket { server 127.0.0.1:28080; } server { listen 443; …
Jim Tebstone
  • 552
  • 6
  • 13
8
votes
1 answer

ActionCable on AWS: Error during WebSocket handshake: Unexpected response code: 404

We are attempting to deploy DHH's simple Rails 5 chat example to a single, self contained EC2 instance on AWS. Code is available here: https://github.com/HectorPerez/chat-in-rails5 We used Elastic Beanstalk to spin up a single instance thus: eb…
KeithP
  • 1,803
  • 1
  • 16
  • 23
7
votes
1 answer

Rails - Server Blocking on Action Cable

I have a Rails app that works perfectly in development. I have deployed to the server and the app loads and correctly shows its landing and about pages. However, when I go to a page with Action Cable, the server blocks. The last request out from the…
El Tea
  • 1,206
  • 12
  • 21