eIRC is a modern, scalable enterprise messaging architecture built on the IRC protocol. Designed for organizations that require ephemeral, real-time communication without the heavy operational overhead of pub/sub systems like Apache Kafka, eIRC delivers high-throughput, low-latency chat experiences while minimizing memory and CPU usage per user.


📌 About eIRC: An Enterprise Chat System Based on IRC
📌 eIRC Technical Specs Technical Architecture Overview
📌 Nginx, PHP, Laravel, C++, LuaJit, Vue Component Licensing
📌 User Identity Synchronization & Authentication
The system is composed of three core architectural tiers:
- Frontend Client (any browser-based or native application)
- Session Bridge Layer (WebSocket server running in OpenResty, per-user IRC client process)
- Infrastructure Services (IRC server, Laravel-based backend, persistent database)
The frontend is a JavaScript application built with Vue 3 and Inertia.js. However, eIRC is frontend-agnostic: any application capable of opening a WebSocket and handling IRC-style messages can integrate with the backend.
- Authenticate user via OAuth2 (Laravel Passport)
- Request short-lived
chat_tokenfrom Laravel (/chatroute) - Open WebSocket connection to OpenResty using
chat_token - Display incoming IRC messages
- Send user input as raw IRC protocol lines (e.g.,
PRIVMSG,JOIN)
Built inside Nginx workers using the lua-resty-websocket and ngx.pipe libraries, this layer bridges the frontend and backend without external WebSocket daemons or Node.js servers.
- Accept WebSocket upgrade requests
- Validate
chat_tokenvia internal API call to Laravel (/api/auth/user/{tokenId}) - Spawn a per-user
irc-clientprocess usingngx.pipe - Connect to the IRC client via a UNIX socket
- Stream IRC messages from the client to the browser
- Forward browser input to the IRC client
- Handle lifecycle cleanup (WebSocket close, IRC process shutdown)
A small, memory-efficient IRC protocol proxy. Each user connection results in one instance of this process. It connects to the IRC server and communicates with the WebSocket server over a UNIX domain socket.
- Authenticate and connect to InspIRCd
- Join channels as directed
- Parse IRC messages and return them via UNIX socket
- Accept frontend commands via socket and translate to IRC protocol
- Shut down cleanly on quit or socket disconnect
- 10 MB resident memory per process
- Minimal CPU load during idle; spiky under large IRC traffic bursts
- Native compiled with ASIO for networking and Ncurses/Unix socket for I/O abstraction
A standard IRC daemon which handles routing, presence, and channel state. No modification required. It is treated as a pure message bus.
- Handle all IRC protocol delivery
- Manage channels, users, joins, parts, and messages
- Coordinate presence and mode tracking
- Optionally clustered (hub-spoke or spanning tree)
A Laravel 12 application responsible for persistent user management, chatroom metadata, and issuing short-lived tokens.
- User authentication via Laravel Passport
- Chatroom metadata API
- OAuth-based login and token issuance
- Serve Inertia-powered frontend for chat UI
- Issue and invalidate
chat_tokenfor WebSocket auth
- Store user profiles, nicknames, preferences
- Track persistent chatroom metadata
- Store issued access tokens for temporary chat access
- Optionally log IRC messages (for analytics or compliance)
- User logs in via Laravel UI
- Laravel issues a short-lived
chat_token(valid for 3 minutes) - Browser sends WebSocket connection request with
?chat_token=xyz - WebSocket server validates token via internal HTTP API to Laravel
- If valid, binds token to Nginx
request_idinngx.shared.DICT - Spawns IRC client process for that session
Tokens are:
- Bound to one connection only
- Deleted after use or timeout
- Prevent session reuse across tabs/devices
- Browser ⟶ WebSocket:
wss://server/chat?chat_token=abc - WebSocket ⟶ Laravel API:
/api/auth/user/{tokenId} - WebSocket ⟶ Spawn IRC client via
ngx.pipe - WebSocket ⟶ Connect to
irc-client.sock - IRC Client ⟶ InspIRCd:
CONNECT,NICK,USER, etc. - IRC ⟶ IRC Client ⟶ WebSocket ⟶ Browser
- WebSocket server runs inside Nginx workers (~20 MB each)
- IRC clients: 10 MB each × N users = predictable memory curve
- Suitable for bare-metal or virtual Linux hosts with high thread count
- Stateless WebSocket workers can be scaled across machines
- Token binding is enforced per instance via shared memory (per Nginx worker)
- Laravel backend and database can be clustered
- IRC server clustering is supported via InspIRCd’s native configuration
Recommended Setup:
- 1 physical or VM host
- Nginx + OpenResty
- PHP-FPM for Laravel
- Redis (optional, for central cache)
- InspIRCd daemon
- 1 Nginx master + N workers
- 1 PHP-FPM pool
- 1 irc-client process per active user
- Message Logging: Use a logger bot to stream messages to Elasticsearch or Redis Streams
- IRC History Bridge: Implement Redis-backed buffer for message replay
- UI Clients: Native mobile apps, Electron clients, embedded widgets
- Audit Trails: Laravel logs all chat_token issuances and user metadata updates
| Feature | eIRC (IRC-Based) | Kafka-Based System |
|---|---|---|
| Memory per connection | ~10MB | High (JVM overhead) |
| Delivery latency | <10ms | ~100ms+ |
| Storage requirements | None (ephemeral) | Always-on logging |
| Protocol complexity | Simple text-based IRC | Avro/Protobuf, partitions |
| Fan-out/multiplexing | Via InspIRCd clustering | Native pub/sub |
| Replay | Not built-in | Built-in |
| Cost per message | Extremely low | High (CPU + I/O) |
eIRC offers a highly efficient alternative to heavyweight enterprise messaging systems. By leveraging IRC’s lightweight protocol, combining it with modern WebSocket infrastructure, and introducing per-user process isolation, it achieves:
- Portability
- Ephemeral real-time communication
- Low infrastructure cost
- Easy integration into existing frontends
This system is best suited for organizations seeking a chat layer that is:
- Ephemeral by design
- Not reliant on persistent log streams
- Lightweight enough for embedded use
- Secure through token-based, OAuth-integrated flows
- Linux host with:
- 4+ CPU cores
- 8+ GB RAM (for ~500 simultaneous users)
- SSD storage for logs and tokens
- Installed services:
- OpenResty (with lua-resty modules)
- InspIRCd
- PHP 8.3 + Laravel 12
- Redis (optional)
- PostgreSQL or MySQL
For technical consultation or implementation support, please contact:
Jesse Greathouse
Email: jesse.greathouse@gmail.com
GitHub: https://github.com/jesse-greathouse/eIRC