-
Notifications
You must be signed in to change notification settings - Fork 31
Support for browsers that don't support websockets #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You're right, this won't work on browsers without WebSocket, like IE9 and old android devices. I think @tjmehta is working on adding support or a fork that will allow alternative implementations to WebSocket. It would be great to have the option. |
I have a ton of work done with this: https://github.com/tjmehta/rethinkdb-primus --- init branch If you're not wanting to use primus I have broken down @mikemintz work into a bunch of modules: |
@tjmehta I'd rather not use primus, but I'm still interested in seeing this issue solved. I don't see any reference to Socket.io or Websockets in any of your links, did you omit that? |
Primus is an abstraction layer upon any "engine" of your choice. Primus can use engine.io(socket.io), socks, or websockets as its engine |
I got everything working, but reconnects are broken. |
@mikemintz While using this with React-Native, I found TcpPolyfill.js around line 59 was failing when data==={}. I fixed it with: I'm confused by how to clone this and test it out, due to the complicated nature of the prepublish/dist/files stuff, since I'm using this indirectly, the main module I'm including directly in my project is react-rethinkdb, which uses this module. But it seems like a fix that should go in. Can you take a look, or should I send a PR? |
@GeoffreyPlitt I think that change might break other cases, like if |
What I do know is that I'm getting an error that says " 'list' argument must be an Array of Buffers" and it's impossible to debug very well, because of the nature of this module, how's it's compiled into the "dist" folder. I hacked some console.log statements into line 6000-something of this module in the the node_modules folder, and my suggestion above seemed to at least bypass this error. Is there an easy way to avoid the prepublish/compilation step, and allow this module to be required from "src" and not be webpack'ed? That would allow me to debug it further. |
Here's a screenshot of my ReactNative error. https://www.dropbox.com/s/e2rk6djnz5yeb7e/Screenshot%202016-08-08%2015.20.33.png?dl=0 @mikemintz Is there an easy way to avoid the prepublish/compilation step, and allow this module to be required from "src" and not be webpack'ed? That would allow me to debug it further. |
@GeoffreyPlitt, if you're still having issues using react-native and rethinkdb-websocket-client, you can post on the related issue mikemintz/react-rethinkdb#11. It appears to be working on both android and iOS. I don't know an easy way to avoid the prepublish step, as the way this library works heavily depends on webpack polyfilling TCP code. |
Cool, thanks |
I was browsing your code and noticed that you don't have any support for browsers that don't support websockets. So my assumption would be that this line would fail since there wouldn't be
WebSocket()
in the global namespace.Are you planning to support for browsers that don't support websockets? Maybe switching to something similar to Socket.IO would be a good alternative. This would also solve your reconnecting problem (#7).
The text was updated successfully, but these errors were encountered: