sjitech / nodejs-android-prebuilt-binaries

Prebuilt binaries of NodeJS for Android(arm,arm64,x86,x64,mipsel), full or limited(by --without-snapshot --without-inspector --without-intl)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"listen" in "http" produces error [arm]

am-trouzine opened this issue · comments

I tried a simple http server example:

var http = require('http');
function fn(eq, res){
  res.writeHead(200, {'Content-Type': 'text/html'});
  res.write(req.url);
  res.end();
}
var server=http.createServer(fn);
server.listen(8000);

It gives the error:

events.js:163
      throw er; // Unhandled 'error' event
      ^

Error: listen EFAULT :::8000
    at Object.exports._errnoException (util.js:1034:11)
    at exports._exceptionWithHostPort (util.js:1057:20)
    at Server._listen2 (net.js:1265:14)
    at listen (net.js:1301:10)
    at Server.listen (net.js:1392:7)
    at Object.<anonymous> (/storage/sdcard0/shell/bin/nodejsServer.js:8:8)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)

Adding the second parameter to liste, also produces an error:

> Error: listen EFAULT 127.0.0.1:8000
    at Object.exports._errnoException (util.js:1034:11)
    at exports._exceptionWithHostPort (util.js:1057:20)
    at Server._listen2 (net.js:1265:14)
    at listen (net.js:1301:10)
    at doListening (net.js:1416:7)
    at _combinedTickCallback (internal/process/next_tick.js:83:11)
    at process._tickDomainCallback (internal/process/next_tick.js:128:9)
>

Here is a screenrecord of the activity:
https://drive.google.com/file/d/1bu9rHT0-Jxg5SQl8e1zjfHDzObMYQQxP/view?usp=sharing