autobahn-js icon indicating copy to clipboard operation
autobahn-js copied to clipboard

Official support for Node WebKit (NW.js)

Open iesrbt opened this issue 6 years ago • 2 comments

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!

iesrbt avatar Jul 11 '18 16:07 iesrbt

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:

  1. [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)
  2. [ ] Document this and add it to AutobahnJS docs

oberstet avatar Aug 23 '18 03:08 oberstet

ok, above PR is merged - what's left is documentation

oberstet avatar Apr 16 '19 07:04 oberstet