Documentation for irc-hybrid-client
Coding Notes

Project Goals

Program Structure

The overall architecture consists of a web server located in the middle between an IRC server and a web browser

The connection to the IRC server is a simple TCP socket wrapped in TLS to pass conventional RFC 2812 messages.

The connection to the web browser is more complex. The primary challenge was addressing disconnect of any socket connections during smartphone screen lock. It is assumed that smartphone is doing this to place radios into power-save idle state to conserve battery.

This has been addressed by utilizing two independent routes for IRC messages to reach the browser. The browser will establish a websocket connection to the web server, wrapped in TLS. The websocket is used to asynchronously pass messages from the IRC server, having been forwarded by the web server, onward toward the browser. The websocket, when connected, is a real time 1 for 1 pass-through of IRC server messages. Therefore, if a smartphone screen lock causes the websocket to disconnect, some messages are potentially lost.

The intermittent websocket issue has been addressed by providing a standard web API, wrapped in TLS, capable of using a POST request to retrieve the contents of a message cache located on the web server. This allows the browser to clear the contents of any open windows and re-populate the display from data in the API response.

Websocket traffic to the browser passes only in one direction, from IRC server to IRC Client. The return side of the websocket is not used. All outgoing IRC message from the IRC client toward the IRC server are sent using a POST request to a message API on the web server.

With this configuration, IRC windows on the web browser page will show real time IRC messages as they arrive. Scroll features allow backwards review of messages. However, if the websocket disconnects from the web server, only messages in the message cache are restored. The current message cache is 100 IRC server messages per IRC channel up a maximum limit of 5 IRC channels. This seems to be a reasonable size for general smartphone use. This is not intended to be a long term offline IRC client.

Network Diagram

Coding Goals

Program Limitations

Version v2.0.0 Upgrade (Sept 2023)