聊天服务器正在监听端口,下面的片段来自控制台日志。
Your code is running at https://mynodetest-someone.c9.io.
Important: use process.env.PORT as the port and process.env.IP as the host in your scripts!
debugger listening on port 15454
info - socket.io started
Chat server listening at 0.0.0.0:4000
当试图通过浏览器连接:例如:"localhost:4000“时,连接将被拒绝(错误代码: ERR_CONNECTION_REFUSED)
有人能帮忙解决这个问题吗?
注意:我试过收听"127.0.0.1“,并给出了网络中的原始IP地址。
发布于 2015-02-19 16:35:39
您可以使用cloud9为该特定服务器/项目提供的URL访问服务器。
使用process.env.PORT
作为端口,process.env.IP
作为应用程序的主机,并使用项目名称-用户名访问应用程序。应该像https://mynodetest-someone.c9.io
一样。
来自c9页面:
Important: use process.env.PORT as the port and process.env.IP as the host in your scripts!
https://stackoverflow.com/questions/28611649
复制相似问题