autobahn-js
autobahn-js copied to clipboard
Official support for Node WebKit (NW.js)
Hi there, In order for autobahn.js to run under NW.js and correctly uses the browser Websocket transport, the dedicated factory (autobahn-js/lib/transport/websocket.js) could be modify like so:
Line 81: if (global.process && global.process.versions.node) { to if (global.process && global.process.versions.node&&!global.process.__nwjs) {
Else autobahn detects node and fails: Unhandled exception raised: TypeError: Cannot read property 'on_internal_error' of undefined at Connection._create_transport (autobahn.js:548) at retry (autobahn.js:675) at Connection.open (autobahn.js:804)
(Also maybe the same could happen for electron?)
Not sure NW.js is one of your target though, so you can merrily close if not. Thanks!
Hi JP (I assume) ;) ok, I see. yeah, as discussed in person, this is simple to fix - the "main effort" is having a test env (node webkit) on our side, so we can actually test a fix.
IOW:
- [x] We want to officially support https://nwjs.io/, shake out any issues that there might be (as obviously above thing) - I don't expect much here (besides above)
- [ ] Document this and add it to AutobahnJS docs
ok, above PR is merged - what's left is documentation