You’re not receiving notifications from this thread.
Question on ActionCable Group Chat part 4, development.rb fix for redis
Saw in the comments the fix for
(REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: websocket) however I added the following to my
config.action_cable.allowed_request_origins = ['http://localhost:3000/']
Is that correct or should I be going to the following when I launch rails s:
(Sorry if this was already answered)
Yep, that'll work fine. You don't have to worry about the redis url at all for that. This is a validation to make sure that the browser origin (the domain that attempted to connect to the websocket) is an allowed one.
Basically you don't want someone on another website stealing your chat messages from another site, so this is a protection built-in for that.
It should default to allow localhost:3000, but it seems people are having trouble with that. Your solution is correct, and you'll add to that when you deploy it to production. 👍
Yeah I keep getting the error even after restarting
rails s showing up though even with my line is now just
.rvm/gems/ruby-2.3.0/gems/redis-3.3.1/lib/redis/client.rb:345:in `rescue in establish_connection': Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED) (Redis::CannotConnectError)
Your redis server isn't running. If you installed it with homebrew, you can type
brew info redis to see the instructions on starting it up again.
Yeah, it's now the default for Rails I believe, so it's a required dependency if you use the defaults. Super easy install with homebrew and everything should be automatically working for you after that.