Skip to content
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

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

Open
am-trouzine opened this issue Mar 5, 2024 · 0 comments
Open

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

am-trouzine opened this issue Mar 5, 2024 · 0 comments

Comments

@am-trouzine
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant