question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

node-nats browser version?

See original GitHub issue

Is there a way to convert node-nats to a browser version?

I have tried with browserify:

 browserify lib/nats.js -o bundle.js

but this doesn’t export the NATS methods properly. Any idea on what I might be missing?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
aricartcommented, Apr 12, 2017

@antonioaguilar unfortunately NATS uses it’s own tcp protocol. So you cannot use it directly from a browser as browsers only do HTTP/S or Websocket.

This means that you’ll need a websocket to tcp proxy, and a library such as https://www.npmjs.com/package/websocket-nats.

3reactions
aricartcommented, Jul 19, 2019

The idea is a different repo. We have an implementation that is waiting on direct websocket support from the server. The API is almost identical to the nats.ts client.

Read more comments on GitHub >

github_iconTop Results From Across the Web

node-nats browser version? · Issue #139 · nats-io/nats.js
Is there a way to convert node-nats to a browser version? I have tried with browserify: browserify lib/nats.js -o bundle.js but this doesn't ......
Read more >
ws-nats - npm
Tested in the following browsers versions: Google Chrome 53+; Firefox 37+; Internet Explorer 11; Microsoft Edge 12+; Safari 9+; Mobile Safari 11 ...
Read more >
NATS.io – Cloud Native, Open Source, High-performance ...
With true multi-tenancy, securely isolate and share your data to fully meet your business needs, mitigating risk and achieving faster time to value....
Read more >
How to detect the version of a browser ? - GeeksforGeeks
Basically, it allows you to know the client web browser version and name and here we need to write different functions for different ......
Read more >
natscode - npm Package Health Analysis | Snyk
node-nats -streaming ... Security and license risk for significant versions ... out the natscode stored in either the browser cookie and or querystring....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found