Skip to content

Commit

Permalink
docs: better wording
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Jan 16, 2024
1 parent c8b6695 commit 6fe919f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -807,14 +807,12 @@ Closes the Store.
## Browser

> [!IMPORTANT]
> The only protocol supported in the browser is MQTT over WebSockets, so you must use `ws://` or `wss://` URLs.
> The only protocol supported in browsers is MQTT over WebSockets, so you must use `ws://` or `wss://` protocols.
While in NodeJS the [ws](https://www.npmjs.com/package/ws) module is used, in the browser the [WebSocket](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) is used.
While the [ws](https://www.npmjs.com/package/ws) module is used in NodeJS, [WebSocket](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) is used in browsers. This is totally transparent to users except for the following:

This is totally transparent to users except for the following:

- The `wsOption` is not supported in the browser.
- Browser doesn't allow to catch many WebSocket errors for [security reasons](https://stackoverflow.com/a/31003057) as:
- The `wsOption` is not supported in browsers.
- Browsers doesn't allow to catch many WebSocket errors for [security reasons](https://stackoverflow.com/a/31003057) as:

> Access to this information could allow a malicious Web page to gain information about your network, so they require browsers report all connection-time errors in an indistinguishable way.
Expand Down

0 comments on commit 6fe919f

Please sign in to comment.