Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,13 @@ There are a few additional options that can be used in all above methods:

```javascript
const Pusher = require("pusher")
const http = require("http")

const pusher = new Pusher({
// you can set other options in any of the 3 ways described above
proxy: "HTTP_PROXY_URL", // optional, URL to proxy the requests through
timeout: TIMEOUT, // optional, timeout for all requests in milliseconds
keepAlive: KEEP_ALIVE, // optional, enables keep-alive, defaults to false
agent: new http.Agent({ keepAlive: true }), // optional, enables keep-alive
})
```

Expand Down Expand Up @@ -170,7 +171,7 @@ pusher.sendToUser("user-1", "test_event", { message: "hello world" })

### Excluding event recipients

In order to avoid the client that triggered the event from also receiving it, a `socket_id` parameter can be added to the `params` object. For more information see: <http://pusher.com/docs/publisher_api_guide/publisher_excluding_recipients>.
In order to avoid the client that triggered the event from also receiving it, a `socket_id` parameter can be added to the `params` object. For more information see: <https://pusher.com/docs/channels/server_api/excluding-event-recipients/>.

```javascript
pusher.trigger(channel, event, data, { socket_id: "1302.1081607" })
Expand Down Expand Up @@ -390,23 +391,23 @@ pusher
pusher.get({ path: "/channels", params: params })
```

Information on the optional `params` and the structure of the returned JSON is defined in the [REST API reference](http://pusher.com/docs/rest_api#method-get-channels).
Information on the optional `params` and the structure of the returned JSON is defined in the [REST API reference](https://pusher.com/docs/channels/library_auth_reference/rest-api/#method-get-channels).

#### Get the state of a channel

```javascript
pusher.get({ path: "/channels/[channel_name]", params: params })
```

Information on the optional `params` option property and the structure of the returned JSON is defined in the [REST API reference](http://pusher.com/docs/rest_api#method-get-channel).
Information on the optional `params` option property and the structure of the returned JSON is defined in the [REST API reference](https://pusher.com/docs/channels/library_auth_reference/rest-api/#method-get-channel).

#### Get the list of users in a presence channel

```javascript
pusher.get({ path: "/channels/[channel_name]/users" })
```

The `channel_name` in the path must be a [presence channel](http://pusher.com/docs/presence). The structure of the returned JSON is defined in the [REST API reference](http://pusher.com/docs/rest_api#method-get-users).
The `channel_name` in the path must be a [presence channel](https://pusher.com/docs/channels/using_channels/presence-channels/). The structure of the returned JSON is defined in the [REST API reference](https://pusher.com/docs/channels/library_auth_reference/rest-api/#method-get-users).

### WebHooks

Expand Down
Loading