javascript - WebSocket not working with Nexe -
i have built nodejs application , using websocket send events browser. need bundle node application exe , send client.
tried nexe , jxcore nexe bundling application giving issue when trying run it.
js code websocket
var websocketserver = require('websocket').server; var http = require('http'); var server = http.createserver(function(request, response) { console.log((new date()) + ' received request ' + request.url); response.writehead(404); response.end(); }); server.listen(1337, function() { console.log((new date()) + ' server listening on port 8080'); }); wsserver = new websocketserver({ httpserver: server, // should not use autoacceptconnections production // applications, defeats standard cross-origin protection // facilities built protocol , browser. should // *always* verify connection's origin , decide whether or not // accept it. autoacceptconnections: false }); wsserver.on('request', function(request) { var connection = request.accept(null, request.origin); eze.ee.on("epic_validating_device" , function() {connection.sendutf('validate')});
the exception stack follows
nexe.js:15318 wsserver = new websocketserver({ ^ typeerror: websocketserver not function @ array.__dirname.call.c:\users\raghav tandon\winpos\browserintegrat ion\js\restimpl.js.http (nexe.js:15318:12) @ initmodule (nexe.js:29:11) @ nexe.js:31:64 @ array.__dirname.call.c:\users\raghav tandon\winpos\browserintegrat ion\js\restws.js../restimpl (nexe.js:48:20) @ initmodule (nexe.js:29:11) @ array.foreach (native) @ nexe.js:39:8 @ nexe.js:46:4 @ nativemodule.compile (node.js:945:5) @ function.nativemodule.require (node.js:893:18)
why not loading webscocket module? have tested application node start , working properly.
this happening because of nexe not able support native modules. rather tried electron works charm , has support native modules well.
Comments
Post a Comment