sockjs for react native

See original GitHub issue

I 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:closed
  • Created 7 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
PavelJcommented, Aug 20, 2017

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 .

2reactions
mdvaccacommented, May 14, 2017

Hi @Excrulon, Did you make it work stomp+sockjs in react-native?

Read more comments on GitHub >

github_iconTop 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 >
react-native-websocket vs socket.io-client vs sockjs - npm trends
Comparing trends for .
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 >

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