如何使用 Socket.IO 访问 Cloud9 上的本地主机

How to access localhost on Cloud9 with Socket.IO

我正在关注 this tutorial 并使用 Cloud9,但是当我 运行 node index.js 我似乎找不到它。

我看过这些 two posts,但似乎都不适合我。我只是按照他们的指示做错了吗?

我需要将服务器设置为侦听 8080(如 Mutahhir suggested) and then point my web browser to http://workspacename.username.c9.io (as Kendell mentioned 在另一个问题上)。确保它是 http 连接,而不是 https 连接。

要将服务器设置为侦听 8080,只需将 index.js 文件中的 3000 更改为 8080

然后,"Hello World" 会如期出现。