我想要做的就是将我的小nodeJS应用程序部署到免费托管站点appFog上。 Nomatter我在我的客户端还是在我的服务器端设置什么端口..我一直得到错误信息:在app上运行NodeJS应用程序
events.js:71
throw arguments[1]; // Unhandled 'error' event
^ Error: listen EADDRINUSE
当这是我的笔记本电脑/台式机上的本地主机上运行,一切正常就好了。
原来这就是我有事情:
客户端:
this.connection = new WebSocket('ws://super1onate.aws.af.cm:1337');
服务器端:
var express = require("express"); // load the express module
var app = express(); // App now holds the server object
// What ports to listen on
app.listen(process.env.VCAP_APP_PORT ||1337);
server.listen(process.env.VCAP_APP_PORT || 1337, function() {
console.log((new Date()) + " Server is listening on port " + webSocketsServerPort); });
否决?我的骄傲受了伤,但我不觉得这是应得的。如果我问这个问题,这种答案会对我有所帮助。 – 2013-02-14 07:37:20
在那里,我投票支持你,反对谁投票给你失望,你破产了 – Captainlonate 2013-02-16 03:05:59