aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAbdelkader Boudih <terminale@gmail.com>2015-07-09 08:51:28 +0100
committerAbdelkader Boudih <terminale@gmail.com>2015-07-09 08:51:28 +0100
commit3357fcd06dbb16e71712d2d853e84f3764c9d0f9 (patch)
tree0b92e8266a1b67e75781c86fbf3f3f9369f42997
parent2253ebd3cef76db40acd32a414bf423f0a43a443 (diff)
parent79b05aece11e5a82a648e5a4893ff75e38334d07 (diff)
downloadrails-3357fcd06dbb16e71712d2d853e84f3764c9d0f9.tar.gz
rails-3357fcd06dbb16e71712d2d853e84f3764c9d0f9.tar.bz2
rails-3357fcd06dbb16e71712d2d853e84f3764c9d0f9.zip
Merge pull request #11 from lsylvester/use-websocket-protocol
update documentation to use websocket protocol
-rw-r--r--README.md6
-rw-r--r--lib/assets/javascripts/cable/consumer.js.coffee4
-rw-r--r--lib/assets/javascripts/cable/subscriptions.js.coffee2
3 files changed, 6 insertions, 6 deletions
diff --git a/README.md b/README.md
index efa3b52dc0..421b7bedd3 100644
--- a/README.md
+++ b/README.md
@@ -74,10 +74,10 @@ The client-side needs to setup a consumer instance of this connection. That's do
```coffeescript
# app/assets/javascripts/cable.coffee
@App = {}
-App.cable = Cable.createConsumer "http://cable.example.com"
+App.cable = Cable.createConsumer "ws://cable.example.com"
```
-The http://cable.example.com address must point to your set of Action Cable servers, and it
+The ws://cable.example.com address must point to your set of Action Cable servers, and it
must share a cookie namespace with the rest of the application (which may live under http://example.com).
This ensures that the signed cookie will be correctly sent.
@@ -249,7 +249,7 @@ bundle exec puma -p 28080 cable/config.ru
```
That'll start a cable server on port 28080. Remember to point your client-side setup against that using something like:
-`App.cable.createConsumer('http://basecamp.dev:28080')`.
+`App.cable.createConsumer('ws://basecamp.dev:28080')`.
Note: We'll get all this abstracted properly when the framework is integrated into Rails.
diff --git a/lib/assets/javascripts/cable/consumer.js.coffee b/lib/assets/javascripts/cable/consumer.js.coffee
index 1df6536831..05a7398e79 100644
--- a/lib/assets/javascripts/cable/consumer.js.coffee
+++ b/lib/assets/javascripts/cable/consumer.js.coffee
@@ -3,7 +3,7 @@
#= require cable/subscriptions
#= require cable/subscription
-# The Cable.Consumer establishes the connection to a server-side Ruby Connection object. Once established,
+# The Cable.Consumer establishes the connection to a server-side Ruby Connection object. Once established,
# the Cable.ConnectionMonitor will ensure that its properly maintained through heartbeats and checking for stale updates.
# The Consumer instance is also the gateway to establishing subscriptions to desired channels through the #createSubscription
# method.
@@ -11,7 +11,7 @@
# The following example shows how this can be setup:
#
# @App = {}
-# App.cable = Cable.createConsumer "http://example.com/accounts/1"
+# App.cable = Cable.createConsumer "ws://example.com/accounts/1"
# App.appearance = App.cable.subscriptions.create "AppearanceChannel"
#
# For more details on how you'd configure an actual channel subscription, see Cable.Subscription.
diff --git a/lib/assets/javascripts/cable/subscriptions.js.coffee b/lib/assets/javascripts/cable/subscriptions.js.coffee
index e1dfff7511..3bc53f2d6a 100644
--- a/lib/assets/javascripts/cable/subscriptions.js.coffee
+++ b/lib/assets/javascripts/cable/subscriptions.js.coffee
@@ -2,7 +2,7 @@
# us Cable.Subscriptions#create, and it should be called through the consumer like so:
#
# @App = {}
-# App.cable = Cable.createConsumer "http://example.com/accounts/1"
+# App.cable = Cable.createConsumer "ws://example.com/accounts/1"
# App.appearance = App.cable.subscriptions.create "AppearanceChannel"
#
# For more details on how you'd configure an actual channel subscription, see Cable.Subscription.