actioncable

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

醉酒当歌 提交于 2019-12-01 04:44:24
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; server_name mydomain; ssl_certificate ***/server.crt; ssl_certificate_key ***/server.key; ssl on; ssl_session_cache builtin:1000 shared:SSL:10m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4; ssl_prefer_server_ciphers on; access_log /var/log/nginx/jenkins.access.log; location / { proxy_set_header Host

Authenticating ActionCable connections

旧时模样 提交于 2019-11-30 21:59:14
I've found a wonderful ActionCable gem, which is a good solution for SPA. I want to send only the html , css and js assets, all other connections will be implemented through ActionCable . It's not difficult to exchange strings or integers, but how can I login through ActionCable? From the Readme # app/channels/application_cable/connection.rb module ApplicationCable class Connection < ActionCable::Connection::Base identified_by :current_user def connect self.current_user = find_verified_user end protected def find_verified_user if current_user = User.find(cookies.signed[:user_id]) current_user

uninitialized constant > ActionCable::Server::Configuration::ApplicationCable

瘦欲@ 提交于 2019-11-30 18:18:26
When I am running server its throwing error shown in logs below. I googled a lot but didn't get reason behind it. Somebody please put some light on it. Gemfile source 'https://rubygems.org' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '>= 5.0.0.beta1', '< 5.1' # Use sqlite3 as the database for Active Record gem 'sqlite3' gem 'active_model_serializers', '~> 0.10.0.rc1' group :development, :test do gem 'byebug' end gem 'puma' group :development do gem 'spring' end Logs: /home/pd/.rvm/gems/ruby-2.2.4/gems/actioncable-5.0.0.beta1/lib/action_cable/server

ActionCable - Failed to upgrade to WebSocket in production

旧巷老猫 提交于 2019-11-30 17:21:12
ActionCable doesn't work in production. Works well in development, but not in production. Running Nginx with Puma on Ubuntu 14.04. I have checked that redis-server is up and running. Rails -v 5.0.0.1 production.log : INFO -- : Started GET "/cable/"[non-WebSocket] for 178.213.184.193 at 2016-11-25 14:55:39 +0100 ERROR -- : Failed to upgrade to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: close, HTTP_UPGRADE: ) INFO -- : Finished "/cable/"[non-WebSocket] for 178.213.184.193 at 2016-11-25 14:55:39 +0100 Request from client: GET ws://mityakoval.com/cable HTTP/1.1 Host: mityakoval.com

ActionCable - Failed to upgrade to WebSocket in production

旧巷老猫 提交于 2019-11-30 14:40:25
问题 ActionCable doesn't work in production. Works well in development, but not in production. Running Nginx with Puma on Ubuntu 14.04. I have checked that redis-server is up and running. Rails -v 5.0.0.1 production.log : INFO -- : Started GET "/cable/"[non-WebSocket] for 178.213.184.193 at 2016-11-25 14:55:39 +0100 ERROR -- : Failed to upgrade to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: close, HTTP_UPGRADE: ) INFO -- : Finished "/cable/"[non-WebSocket] for 178.213.184.193 at 2016-11-25 14

Connecting to ActionCable from iOS app

回眸只為那壹抹淺笑 提交于 2019-11-30 12:01:49
问题 I have been stuck on this all day. I have the very simple ActionCable example app (the chat app) by David Heinemeier Hansson working correctly (https://www.youtube.com/watch?v=n0WUjGkDFS0). I am trying to hit the websocket connection with an iPhone app. I am able to receive pings when I connect to ws://localhost:3000/cable , but I'm not quite sure how to subscribe to channels from outside of a javascript context. 回答1: Oh man, I went through this problem too after reading this question. After

How do I get current_user in ActionCable rails-5-api app?

我们两清 提交于 2019-11-30 11:39:12
Why am I not able to retrieve current_user inside my channel or how should I retrieve current_user ? What do I use? Rails 5.0.1 --api (I do NOT have any views NOR use coffee) I use react-native app to test this (Works fine WITHOUT authorization) I do NOT use devise for auth (I use JWT instead using Knock , so no cookies) Trying to get current_user inside my ActionCable channel as described in rubydoc.info The code looks like class MessageChannel < ApplicationCable::Channel identified_by :current_user def subscribed stream_from 'message_' + find_current_user_privileges end def unsubscribed #

uninitialized constant > ActionCable::Server::Configuration::ApplicationCable

怎甘沉沦 提交于 2019-11-30 02:33:52
问题 When I am running server its throwing error shown in logs below. I googled a lot but didn't get reason behind it. Somebody please put some light on it. Gemfile source 'https://rubygems.org' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '>= 5.0.0.beta1', '< 5.1' # Use sqlite3 as the database for Active Record gem 'sqlite3' gem 'active_model_serializers', '~> 0.10.0.rc1' group :development, :test do gem 'byebug' end gem 'puma' group :development do gem 'spring'

Connecting to ActionCable from iOS app

邮差的信 提交于 2019-11-30 01:54:38
I have been stuck on this all day. I have the very simple ActionCable example app (the chat app) by David Heinemeier Hansson working correctly ( https://www.youtube.com/watch?v=n0WUjGkDFS0 ). I am trying to hit the websocket connection with an iPhone app. I am able to receive pings when I connect to ws://localhost:3000/cable , but I'm not quite sure how to subscribe to channels from outside of a javascript context. Zhang Oh man, I went through this problem too after reading this question. After a while, I finally found this magical Github issue page: https://github.com/rails/rails/issues/22675

How do I get current_user in ActionCable rails-5-api app?

匆匆过客 提交于 2019-11-29 17:22:49
问题 Why am I not able to retrieve current_user inside my channel or how should I retrieve current_user ? What do I use? Rails 5.0.1 --api (I do NOT have any views NOR use coffee) I use react-native app to test this (Works fine WITHOUT authorization) I do NOT use devise for auth (I use JWT instead using Knock , so no cookies) Trying to get current_user inside my ActionCable channel as described in rubydoc.info The code looks like class MessageChannel < ApplicationCable::Channel identified_by