2017-01-26 3 views
0

간단한 노드 서버를 작성하고 그것을 과장하려고합니다. 하지만 다음과 같은 오류가 있습니다.노드 응용 프로그램을 활성화시키지 못했습니다.

torsocks 없이도 제대로 작동하며 tor daemon의 기본 구성을 사용했습니다.

$ torsocks node server.js 
[Jan 26 09:38:40] WARNING torsocks[30933]: [syscall] Unsupported syscall number 293. Denying the call (in tsocks_syscall() at syscall.c:465) 
events.js:160 
     throw er; // Unhandled 'error' event 
    ^

Error: listen EPERM :::5000 
    at Object.exports._errnoException (util.js:1022:11) 
    at exports._exceptionWithHostPort (util.js:1045:20) 
    at Server._listen2 (net.js:1259:14) 
    at listen (net.js:1295:10) 
    at Server.listen (net.js:1391:5) 
    at Object.<anonymous> (/home/test/src/heroku/ruten-helper/server.js:10:8) 
    at Module._compile (module.js:570:32) 
    at Object.Module._extensions..js (module.js:579:10) 
    at Module.load (module.js:487:32) 
    at tryModuleLoad (module.js:446:12) 

답변

2

var http = require('http') 
 

 
// Create server 
 
var server = http.createServer(function (req, res) { 
 
    console.log("client connected") 
 
    res.end('HI!') 
 
}) 
 

 
// Listen 
 
server.listen(process.env.PORT || 5000)

나는 그것을 얻었다. torsocks 디버그 메시지를 확인한 결과는 다음과 같습니다.

[수신] 로컬 호스트가 아닌 인바운드 연결은 허용되지 않습니다. (tsocks_listen() in listen.c : 64)

그리고 로컬 호스트에서만 수신 대기하도록 코드를 변경했습니다. 문제가 해결되었습니다.

관련 문제