如何修复错误:在使用NodeJS时侦听EADDRINUSE?
Error: listen EADDRINUSE
net.createServer(function (socket) { socket.name = socket.remoteAddress + ":" + socket.remotePort; console.log('connection request from: ' + socket.remoteAddress); socket.destroy(); }).listen(options.port);
var xhr = new XMLHttpRequest();xhr.onreadystatechange = function() { sys.puts("State: " + this.readyState); if (this.readyState == 4) { sys.puts("Complete.\nBody length: " + this.responseText.length); sys.puts("Body:\n" + this.responseText); }};xhr.open("GET", "http://mywebsite.com");xhr.send();
长风秋雁
小怪兽爱吃肉
相关分类