diff options
Diffstat (limited to 'actioncable')
-rw-r--r-- | actioncable/README.md | 18 | ||||
-rw-r--r-- | actioncable/lib/action_cable/engine.rb | 2 | ||||
-rw-r--r-- | actioncable/test/client_test.rb | 3 |
3 files changed, 5 insertions, 18 deletions
diff --git a/actioncable/README.md b/actioncable/README.md index b5eababa90..b3bfd83120 100644 --- a/actioncable/README.md +++ b/actioncable/README.md @@ -7,7 +7,6 @@ and scalable. It's a full-stack offering that provides both a client-side JavaScript framework and a server-side Ruby framework. You have access to your full domain model written with Active Record or your ORM of choice. - ## Terminology A single Action Cable server can handle multiple connection instances. It has one @@ -300,7 +299,6 @@ The rebroadcast will be received by all connected clients, _including_ the clien See the [rails/actioncable-examples](https://github.com/rails/actioncable-examples) repository for a full example of how to setup Action Cable in a Rails app, and how to add channels. - ## Configuration Action Cable has three required configurations: a subscription adapter, allowed request origins, and the cable server URL (which can optionally be set on the client side). @@ -444,21 +442,13 @@ The Ruby side of things is built on top of [websocket-driver](https://github.com ## Deployment +>>>>>>> b94b04b1d11b1d095918b8bae2b6b5f76f092cf7 -Action Cable is powered by a combination of WebSockets and threads. All of the -connection management is handled internally by utilizing Ruby’s native thread -support, which means you can use all your regular Rails models with no problems -as long as you haven’t committed any thread-safety sins. + $ gem install actioncable -The Action Cable server does _not_ need to be a multi-threaded application server. -This is because Action Cable uses the [Rack socket hijacking API](http://www.rubydoc.info/github/rack/rack/file/SPEC#Hijacking) -to take over control of connections from the application server. Action Cable -then manages connections internally, in a multithreaded manner, regardless of -whether the application server is multi-threaded or not. So Action Cable works -with all the popular application servers -- Unicorn, Puma and Passenger. +Source code can be downloaded as part of the Rails project on GitHub -Action Cable does not work with WEBrick, because WEBrick does not support the -Rack socket hijacking API. +* https://github.com/rails/rails/tree/master/actioncable ## License diff --git a/actioncable/lib/action_cable/engine.rb b/actioncable/lib/action_cable/engine.rb index 96176e0014..34f9952c71 100644 --- a/actioncable/lib/action_cable/engine.rb +++ b/actioncable/lib/action_cable/engine.rb @@ -22,7 +22,7 @@ module ActionCable initializer "action_cable.set_configs" do |app| options = app.config.action_cable - options.allowed_request_origins ||= "http://localhost:3000" if ::Rails.env.development? + options.allowed_request_origins ||= /https?:\/\/localhost:\d+/ if ::Rails.env.development? app.paths.add "config/cable", with: "config/cable.yml" diff --git a/actioncable/test/client_test.rb b/actioncable/test/client_test.rb index f4b4a53aea..283ba9daaf 100644 --- a/actioncable/test/client_test.rb +++ b/actioncable/test/client_test.rb @@ -1,9 +1,6 @@ require 'test_helper' require 'concurrent' -require 'active_support/core_ext/hash/indifferent_access' -require 'pathname' - require 'faye/websocket' require 'json' |