Skip to content

Conversation

@mjcross
Copy link

@mjcross mjcross commented Nov 7, 2025

Just to add a short comment to the example, as a hint for users wanting to publish a binary message from the browser.
It can be confusing to know how to do that, when you don't have node.js Buffer available.

For a new user it can be confusing how to publish a binary message from the browser.
@mjcross mjcross changed the title Add comment to simple-publish.js (binary msg) docs: add comment to simple-publish.js (binary msg) Nov 7, 2025
Copy link
Member

@robertsLando robertsLando left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this comment should be placed on readme instead

@mjcross
Copy link
Author

mjcross commented Nov 8, 2025

Sounds good to me, @robertsLando - I'll have a look at that

Illustrates how to publish a binary message (from a browser)
@mjcross
Copy link
Author

mjcross commented Nov 8, 2025

@robertsLando hope this looks OK 91f6e46


- `topic` is the topic to publish to, `String`
- `message` is the message to publish, `Buffer` or `String`
- `message` is the message to publish, `Buffer` (in browser `Uint8Array`) or `String`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is enough, no need to also add an example

Copy link
Author

@mjcross mjcross Nov 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure - although as a user, I can say examples are incredibly valuable (and it also illustrates how to make a WSS connection, which gives a 'self contained' example for how to connect from a browser)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants