sockjs for react native
See original GitHub issueI was looking into using stomp+sockjs in a react native project. So far, stomp seems okay. sockjs, however, has several issues. The import paths are messed up since it’s for browser. For example:
Doing some weird stuff here: https://github.com/sockjs/sockjs-client/blob/master/package.json#L7-L11
Change this line here: https://github.com/sockjs/sockjs-client/blob/master/lib/transport/websocket.js#L6
to:
, EventEmitter = require('../event/emitter')
And it fixes that instance. There are like 20 more of these paths to be updated (not all the same). After all those paths are fixed, I get this:
Object prototype may only be an Object or null.
stack:
inherits\inerits_browser.js:5
sockjs-client\lib\transport\websocket.js:59
...
Not sure about this one. It may have to do with crypto? No clue, really.
Any ideas? Anyone have any success getting this to work with react native?
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (2 by maintainers)
Top Results From Across the Web
Stomp and SockJs in a React Native - Stack Overflow
Can anyone provide successful implementation of Stomp + SocketJS inside the React Native project? just how to connect it and use ...
Read more >SockJS and StompJS in React Native : r/reactnative - Reddit
Currently, I do have a ready backend with a web example of using Stomp with SockJS for a chat application.
Read more >How to implement WebSockets in React Native
In this tutorial, we'll walk you through how to implement WebSockets in React Native by designing a message broadcast app.
Read more >chapter26/TodoRelayWeb/node_modules/sockjs-client
SockJS is a browser JavaScript library that provides a WebSocket-like object. SockJS gives you a coherent, cross-browser, Javascript API which creates a low ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Since this is first match on Goggle for things related to SockJS and React Native - version 1.1.4 works using following small fix in this fork: https://github.com/datso/sockjs-client/commit/34150437996b9f5ad169b60e638fe50f8608d724 .
Hi @Excrulon, Did you make it work stomp+sockjs in react-native?