我正在使用 WebSockets 开发一个站点,并且我正在使用 XSockets.NET 来实现整个 WebSockets 服务器。
此外,我能够从开发机器中访问 XSocket.NET 控制器,但我无法从另一台机器访问它。
顺便说一句,这不是 DNS 问题,因为网站本身可以从任何其他机器上浏览:它与 WebSockets 相关。
目前我在 Firebug 中收到以下错误:Firefox 无法建立与服务器 [...] 的连接,其中服务器是端口 7532 上的整个主机名。
我可以提供我如何配置和启动整个 WebSockets 服务器的示例代码:
IXSocketServerContainer server = Composable.GetExport<IXSocketServerContainer>();
List<IConfigurationSetting> serverConfig = new List<IConfigurationSetting>();
serverConfig.Add(new ConfigurationSetting("ws://[host name]:7532", new HashSet<string> { "*" }));
server.StartServers(configurationSettings: serverConfig);
此外,整个 XSockets.NET 托管在 Windows 服务中,我正在使用开箱即用的 XSockets.NET JavaScript API 连接到 XSocket.NET 控制器:
// This will work as expected when I open my site from the development machine
var conn = new XSockets.WebSocket("ws://[host name]:7352/[controller name]");
conn.on(XSockets.Events.open, function (clientInfo) {
conn.subscribe("[Action name]", function (message) {
});
});
什么会阻止其他机器连接到整个 WebSocket 服务器?我错过了什么?