osflab/osf-irc

Simple telnet IRC server

v3.0.0 2018-01-29 20:55 UTC

This package is not auto-updated.

Last update: 2021-11-27 13:07:19 UTC


README

A simple IRC server which uses telnet as client.

Requirements

  • PHP7.1 or more
  • The pcntl extension
  • composer

Requirements installation on debian/ubuntu:

sudo add-apt-repository -y ppa:ondrej/php
sudo apt update -y
sudo apt install php7.1-cli composer

Installation

composer create-project --prefer-dist osflab/osf-irc osf-irc

Usage

To start the server:

php ./osf-irc/bin/irc-run.php [host_or_ip]

Replace [host_or_ip] by the address of the network device to bind. If you do not specify this value, the server may bind to localhost, you will not be able to use it from a remote machine.

For each client:

  • In a new terminal, type telnet <hostname> 9999 (replace <hostname> by yours)
  • Enter your name + [enter]: a number is displayed
  • Open a new terminal and type telnet <hostname> 9999 again
  • Enter the number

You can use the first terminal for reading and the second one to write. Repeat this for each client.

Additional information

Originally, this component is a demonstration of developing a deamon with PHP, using the pcntl extension. It addresses process management concepts, semaphores and network sockets.