Skip to content

Commit b49742e

Browse files
committed
docs: fix createWebsocket example
1 parent 56e6e23 commit b49742e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -244,18 +244,18 @@ through a proxy with custom authentication this callback allows you to create yo
244244
instance of a websocket which will be used in the mqtt client.
245245

246246
```js
247-
const createWebsocket = createWebsocket(url, websocketSubProtocols, options) => {
247+
const createWebsocket = (url, websocketSubProtocols, options) => {
248248
const subProtocols = [
249249
websocketSubProtocols[0],
250250
'myCustomSubprotocolOrOAuthToken',
251251
]
252252
return new WebSocket(url, subProtocols)
253253
}
254254

255-
const connection = await mqtt.connectAsync(<wss url>, {
256-
...,
257-
createWebsocket: createWebsocket,
258-
});
255+
const client = await mqtt.connectAsync(<wss url>, {
256+
...,
257+
createWebsocket: createWebsocket,
258+
});
259259
```
260260

261261
#### Enabling Reconnection with `reconnectPeriod` option

0 commit comments

Comments
 (0)