在 Windows 服务器上部署 Socket.io [英] Deploying Socket.io on a windows server

查看:59
本文介绍了在 Windows 服务器上部署 Socket.io的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个基本的聊天 socket.io node.js 应用程序在运行 Windows 7 的 Windows 服务器的本地主机上工作.

I have a basic chat socket.io node.js application working on the localhost of a Windows server running Windows 7.

Node 和 Socket.io 安装没有任何问题,当我通过 RDC 将我的应用程序运行到 Windows 服务器时,套接字工作正常.

Node and Socket.io installed without any issue and when I run my application through RDC to the windows server, the socket works perfectly.

我正在努力解决的是如何访问套接字,例如外部socket.io/socket.io.js".

What I'm struggling with is how i access the socket e.g. "socket.io/socket.io.js" externally.

我会假设它不是localhost:8000/socket.io/socket.io.js",它应该是{server_ip}:8000/socket.io/socket.io.js",但是确实如此工作.

I would have assumed it would be rather than "localhost:8000/socket.io/socket.io.js" it owuld be "{server_ip}:8000/socket.io/socket.io.js" however this does work.

我看到了一些关于 iisnode 的讨论,但似乎该实现尚不支持套接字.

I saw some discussion about iisnode, but it seems that sockets arent supported yet with that implementation.

有什么建议吗?

推荐答案

原来是防火墙问题阻止了对该端口的访问,我的托管公司设法为我解决了这个问题,所以我在其中使用了 socket.io通过节点命令提示符的正常方式.

It turned out to be a firewall issue that was blocking access to that port which my hosting company managed to resolve for me so I'm using socket.io in the normal manner through a node command prompt.

感谢您的建议,我确实尝试过 Iisnode,但正如您所说,发现不支持套接字.

Thanks for the advice, I did try Iisnode and like you said found that sockets weren't supported.

这篇关于在 Windows 服务器上部署 Socket.io的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆