You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-27Lines changed: 14 additions & 27 deletions
Original file line number
Diff line number
Diff line change
@@ -25,35 +25,27 @@ Creating a new Pusher `client` can be done as follows.
25
25
26
26
```ruby
27
27
pusher_client =Pusher::Client.new(
28
-
app_id:'your-pusher-app-id',
29
-
key:'your-pusher-key',
30
-
secret:'your-pusher-secret'
28
+
app_id:'your-app-id',
29
+
key:'your-app-key',
30
+
secret:'your-app-secret',
31
+
cluster:'your-app-cluster',
31
32
)
32
33
```
34
+
The cluster value will set the `host` to `api-<cluster>.pusher.com`.
33
35
34
36
If you want to set a custom `host` value for your client then you can do so when instantiating a Pusher client like so:
35
37
36
38
```ruby
37
39
pusher_client =Pusher::Client.new(
38
-
app_id:'your-pusher-app-id',
39
-
key:'your-pusher-key',
40
-
secret:'your-pusher-secret',
41
-
host:'your-pusher-host'
40
+
app_id:'your-app-id',
41
+
key:'your-app-key',
42
+
secret:'your-app-secret',
43
+
host:'your-app-host'
42
44
)
43
45
```
44
46
45
-
If you created your app in a different cluster to the default cluster, you must pass the `cluster`option as follows:
47
+
If you pass both `host` and `cluster` options, the `host` will take precendence and `cluster`will be ignored.
46
48
47
-
```ruby
48
-
pusher_client =Pusher::Client.new(
49
-
app_id:'your-pusher-app-id',
50
-
key:'your-pusher-key',
51
-
secret:'your-pusher-secret',
52
-
cluster:'your-app-cluster'
53
-
)
54
-
```
55
-
56
-
This will set the `host` to `api-<cluster>.pusher.com`. If you pass both `host` and `cluster` options, the `host` will take precendence and `cluster` will be ignored.
57
49
58
50
Finally, if you have the configuration set in an `PUSHER_URL` environment
Configuring Pusher can also be done globally on the Pusher class.
68
60
69
61
```ruby
70
-
Pusher.app_id ='your-pusher-app-id'
71
-
Pusher.key ='your-pusher-key'
72
-
Pusher.secret ='your-pusher-secret'
73
-
```
74
-
75
-
If you created your app in a different cluster to the default cluster, you must set it as follows:
76
-
77
-
```ruby
62
+
Pusher.app_id ='your-app-id'
63
+
Pusher.key ='your-app-key'
64
+
Pusher.secret ='your-app-secret'
78
65
Pusher.cluster ='your-app-cluster'
79
66
```
80
67
81
-
Global configuration will automatically be set from the `PUSHER_URL` environment variable if it exists. This should be in the form `http://KEY:SECRET@api.pusherapp.com/apps/APP_ID`. On Heroku this environment variable will already be set.
68
+
Global configuration will automatically be set from the `PUSHER_URL` environment variable if it exists. This should be in the form `http://KEY:SECRET@HOST/apps/APP_ID`. On Heroku this environment variable will already be set.
82
69
83
70
If you need to make requests via a HTTP proxy then it can be configured
0 commit comments