node.jssocketsmeteorwebsocketirc

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


I am planning build an IRC network and been exploring options. I am planning to use Inspircd IRC Server. Along with a webserver running meteor. 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?

Secondly, If Yes to above, what are the pros/cons of having IRCclient <-> IRCServer vs IRCclient <-> WebScoketGateway (/webserver) <-> IRC Server relationship.

I see most of the modules involving node or meteor (including socket.io) use a WSGI, why is that? Am I missing something here?

Please note in this case, both IRC Server and Webserver are run by me and hence the possibility of making the browser believe both are same boxes.


Solution

  • 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?

    No. WebSockets are a layer inside HTTP, i.e. the client sends a HTTP request with an Upgrade header and the server responds with a HTTP response acknowledging the Upgrade request. The data is exchanged as binary messages (with their own framing) and also usually xor'ed with some key.

    Thus you cannot send arbitrary and also not IRC data to a non-WebSocket server but you need a gateway to translate from the WebSocket handshake and frames to normal TCP.