A small, modern IRC server written in PHP 8.5 as a learning and portfolio project. It uses Tempest for the application and dependency-injection layer, and Amp with Revolt for asynchronous networking.
The aim is a focused, single-server implementation that works with normal IRC clients without attempting to reproduce every legacy or server-to-server feature. Live clients and channels are held in memory, with boundaries that leave room for persistence or alternative transports later.
- IRC message parsing and encoding, including message tags
- TCP listener, line buffering, message-size validation and connection cleanup
- Automatic command-handler discovery and dispatch
-
CAP LSandCAP ENDregistration negotiation -
NICK, including validation, collisions and nickname changes -
USERand client registration -
PINGresponses - Registration welcome numerics and
005feature advertisement - Unknown-command and not-registered responses
- ASCII IRC casemapping for nicknames and channels
- In-memory channel, membership and channel-registry foundations
-
JOIN, channel broadcasting and names replies - Unit and integration test suite
Requirements:
- PHP 8.5
- Composer
Install dependencies and start the server:
composer install
php tempest irc:serveBy default, it listens on 127.0.0.1:6667. You can connect with an IRC client or test it with netcat:
nc 127.0.0.1 6667Then register and send a ping:
NICK John
USER john 0 * :John Doe
PING :hello
The defaults can be overridden in .env:
IRC_SERVER_NAME=irc.local
IRC_NETWORK_NAME=PHPIRC
IRC_SERVER_VERSION=phpirc-0.1.0
LISTEN_ADDRESS=127.0.0.1
LISTEN_PORT=6667Run all quality checks with:
composer qa- Client delivery and channel broadcasting
- Standalone
NAMEScommand - Channel cleanup when clients disconnect
-
PARTandQUIT -
PRIVMSGandNOTICEfor clients and channels - Topics, channel modes and operator commands such as
KICK - Multiple listeners and TLS
- Broader IRCv3 capability support
- Optional persistence where it provides value
Licensed under the MIT Licence.