是否可以让 IRC 客户端使用 websockets 运行 您自己的 IRC 服务器而无需 websockets 网关?

Is it possible to have an IRC client using websockets running your own IRC server without a websockets gateway?

我正计划建立一个 IRC 网络并一直在探索各种选择。我打算使用 Inspircd IRC Server. Along with a webserver running meteor。是否可以使用 websockets 构建一个 web IRC 客户端而不使用 webscokets 网关(以减少 web 服务器上的负载)并直接连接到 IRC Inspircd 框?

其次,如果以上是,IRCclient <-> IRCServerIRCclient <-> WebScoketGateway (/webserver) <-> IRC Server 关系的 pros/cons 是什么。

我看到大多数涉及 node 或 meteor 的模块(包括 socket.io)都使用 WSGI,这是为什么呢?我在这里遗漏了什么吗?

请注意,在这种情况下,IRC Server 和 Webserver 都是我 运行,因此有可能让浏览器相信它们是同一个盒子。

Is it possible to build a web IRC client with websockets and NOT using a webscokets gateway (to reduce load on webserver) and directly connect to the IRC Inspircd box?

没有。 WebSockets 是 HTTP 内部的一个层,即客户端发送带有升级 header 的 HTTP 请求,服务器响应确认升级请求的 HTTP 响应。数据以二进制消息的形式交换(具有自己的框架),并且通常还与一些密钥进行异或运算。

因此,您不能向 non-WebSocket 服务器发送任意数据,也不能发送 IRC 数据,但您需要一个网关来将 WebSocket 握手和帧转换为普通 TCP。

UnrealIRCd 4.0.10 及更高版本 support the WebSocket protocol(ws:// 和 wss://)。 WebSocket 帧交换与标准 IRC 连接相同的消息。