{"id":15047193,"url":"https://github.com/soofiane262/ft_irc","last_synced_at":"2025-04-10T00:50:57.618Z","repository":{"id":151021796,"uuid":"610727409","full_name":"soofiane262/ft_irc","owner":"soofiane262","description":"This project is about creating our own IRC server","archived":false,"fork":false,"pushed_at":"2023-04-12T21:26:02.000Z","size":344,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T00:50:54.709Z","etag":null,"topics":["cpp98","irc-server"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/soofiane262.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-07T11:07:55.000Z","updated_at":"2024-04-09T02:26:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"ce796ada-d157-4d19-9bbd-1447d2f10414","html_url":"https://github.com/soofiane262/ft_irc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soofiane262%2Fft_irc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soofiane262%2Fft_irc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soofiane262%2Fft_irc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soofiane262%2Fft_irc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/soofiane262","download_url":"https://codeload.github.com/soofiane262/ft_irc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137999,"owners_count":21053775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp98","irc-server"],"created_at":"2024-09-24T20:55:09.560Z","updated_at":"2025-04-10T00:50:57.584Z","avatar_url":"https://github.com/soofiane262.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ccenter\u003e\n\n# **FT_IRC - Internet Relay Chat**\n\n[![sel-mars's 42 ft_irc Score](https://badge42.vercel.app/api/v2/cl49y2gyb004909l3hwkwo9dg/project/3014927)](https://github.com/JaeSeoKim/badge42)\n\n\u003c/center\u003e\n\n---\n\n## Table of Contents\n\n-   [Summary](#summary)\n-   [Introduction](#introduction)\n-   [General Rules](#general-rules)\n-   [Features](#features)\n-   [Getting Started](#getting-started)\n-   [Usage](#usage)\n-   [Commands](#commands)\n-   [Resources](#resources)\n-   [Authors](#authors)\n-   [Contributing](#contributing)\n-   [License](#license)\n\n### _Summary_\n\n`FT_IRC` is an IRC server project that enables real-time messaging through text-based communication protocol on the Internet. The server is compliant with [RFC 2812](https://www.rfc-editor.org/rfc/rfc2812) and allows users to exchange direct messages and join group channels.\n\n### _Introduction_\n\nInternet Relay Chat (IRC) is a protocol that enables users to communicate with each other in real-time via text. It was created in the late 1980s and has been a popular form of communication on the Internet ever since. The protocol offers public and private messaging, as well as the ability to join channels with multiple users. Clients connect to servers in order to access the IRC network, and servers can be connected together to form a larger network.\n\n### _General Rules_\n\nThe program is designed not to crash in any circumstance, including running out of memory or quitting unexpectedly. A Makefile is included that compiles the source files and includes rules for `$(NAME)`, `all`, `clean`, `fclean`, and `re`. The code is written in C++ 98 and complies with that standard. There are no external libraries or Boost libraries used.\n\n### _Features_\n\n`FT_IRC` server project comes with the following features:\n\n-   Multiple clients can be handled simultaneously without ever hanging\n-   Non-blocking I/O operations with only one poll() used to handle all operations (read, write, listen, etc.)\n-   Supports authentication, setting a nickname, a username, joining a channel, and sending and receiving private messages\n-   Messages sent from one client to a channel are forwarded to every other client that joined the channel\n-   Supports operators and regular users\n-   Implements commands that are specific to operators\n-   Supports [LimeChat] as a reference client for evaluation purposes\n-   File transfer using DCC in [LimeChat]\n-   A bot using the [`42 API`](https://api.intra.42.fr/apidoc) to retrieve logtime of the current month, current location or coalition of any user\n\n### _Getting Started_\n\nFollow these simple steps to get started with the IRC Server Project:\n\n1. Clone the repository to your local machine:\n\n```sh\nhttps://github.com/soofiane262/ft_irc.git\n```\n\n2. Navigate to the project directory:\n\n```sh\ncd ft_irc\n```\n\n3. Compile the source files by running the make command:\n\n```sh\nmake\n```\n\n4. Start the IRC server:\n\n```sh\n./ircserv \u003cport\u003e \u003cpassword\u003e\n```\n\nReplace `\u003cport\u003e` with the port number on which the server will be listening for incoming IRC connections and `\u003cpassword\u003e` with the connection password.\n\n5. Connect to the server using an IRC client such as [LimeChat] or by using netcat with the following command:\n\n```sh\nnc -c localhost \u003cport\u003e\n```\n\n6. Authenticate with the server password and set your nickname and username:\n\n```sh\nPASS \u003cpassword\u003e\nNICK \u003cnickname\u003e\nUSER \u003cusername\u003e \u003cmode\u003e * :\u003crealname\u003e\n```\n\n7. Join a channel and start sending messages to other users:\n\n```sh\nJOIN \u003cchannel\u003e\nPRIVMSG \u003cchannel\u003e :Hello fellow peers :)\n```\n\n**Congratulations!** You're now connected to your own IRC server and can start chatting with others.\n\n### _Usage_\n\nAfter starting the server, clients can connect to it and communicate with each other through various IRC operations. They can join or create channels, send messages to other users or channels, and perform various IRC operations using the supported commands listed below.\n\n### _Commands_\n\nOur server supports several commands, conforming to the [BNF] representation specified in RFC2812. Here are the commands and their [BNF] representations:\n\n```bnf\nCommand: AWAY\nParameters: [ \u003ctext\u003e ]\n```\n\nThe AWAY command is used to set an away message for the user. If the `\u003ctext\u003e` parameter is included, it specifies the away message. If the `\u003ctext\u003e` parameter is omitted, it means that the user is no longer away.\n\n```bnf\nCommand: BOT\nParameters: \u003cbotcmd\u003e [ \u003cbotparams\u003e ]\n```\n\nThe BOT command is used to send a command to a bot in the channel. The `\u003cbotcmd\u003e` parameter specifies the command to be executed, and the `\u003cbotparams\u003e` parameter provides any additional parameters that the command requires.\n\n```bnf\nCommand: DIE\nParameters: None\n```\n\nThe DIE command is used to shut down the server. This command is only available to server operators.\n\n```bnf\nCommand: INVITE\nParameters: \u003cnickname\u003e \u003cchannel\u003e\n```\n\nThe INVITE command is used to invite a user to a specific channel. The `\u003cnickname\u003e` parameter specifies the user to be invited, and the `\u003cchannel\u003e` parameter specifies the channel to which the user is to be invited.\n\n```bnf\nCommand: JOIN\nParameters: \u003cchannel\u003e [ \u003ckey\u003e ]\n```\n\nThe JOIN command is used to join a specific channel. The `\u003cchannel\u003e` parameter specifies the channel to be joined, and the `\u003ckey\u003e` parameter provides the channel password, if required.\n\n```bnf\nCommand: KICK\nParameters: \u003cchannel\u003e \u003cuser\u003e [ \u003creason\u003e ]\n```\n\nThe KICK command is used to kick a user from a specific channel. The `\u003cchannel\u003e` parameter specifies the channel from which the user is to be kicked, and the `\u003cuser\u003e` parameter specifies the user to be kicked. The `\u003creason\u003e` parameter provides the reason for the kick.\n\n```bnf\nCommand: LIST\nParameters: [ \u003cchannels\u003e [ \u003cserver\u003e ] ]\n```\n\nThe LIST command is used to list all channels on the server. The `\u003cchannels\u003e` parameter specifies the channels to be listed, and the `\u003cserver\u003e` parameter specifies the server to be queried. If the `\u003cchannels\u003e` and `\u003cserver\u003e` parameters are omitted, the server will list all channels on the server.\n\n```bnf\nCommand: MODE\nParameters: \u003cchannel\u003e \u003cmodes\u003e [ \u003cmodeparams\u003e ]\n```\n\nThe MODE command is used to set or query the mode of a specific channel. The `\u003cchannel\u003e` parameter specifies the channel to be modified, the `\u003cmodes\u003e` parameter specifies the mode(s) to be set, and the `\u003cmodeparams\u003e` parameter provides any additional parameters required for the mode(s).\n\n```bnf\nCommand: NAMES\nParameters: [ \u003cchannels\u003e [ \u003cserver\u003e ] ]\n```\n\nThe NAMES command is used to list all users in a specific channel or all channels on the server. The `\u003cchannels\u003e` parameter specifies the channel(s) to be listed, and the `\u003cserver\u003e` parameter specifies the server to be queried. If the `\u003cchannels\u003e` and `\u003cserver\u003e` parameters are omitted, the server will list all users in all channels on the server.\n\n```bnf\nCommand: NICK\nParameters: \u003cnickname\u003e\n```\n\nThe NICK command is used to change a user's nickname. The `\u003cnickname\u003e` parameter specifies the new nickname.\n\n```bnf\nCommand: NOTICE\nParameters: \u003cnickname\u003e \u003ctext\u003e\n```\n\nThe NOTICE command is used to send a notice message to a specific user. The `\u003cnickname\u003e` parameter specifies the user to whom the notice is to be sent, and the `\u003ctext\u003e` parameter specifies the text of the notice.\n\n```bnf\nCommand: OPER\nParameters: \u003cusername\u003e \u003cpassword\u003e\n```\n\nOper command is used to authenticate a user as an IRC operator or \"ircop\" (one who manages an IRC network) with a password.\n\n```bnf\nCommand: PART\nParameters: \u003cchannel\u003e [ \u003creason\u003e ]\n```\n\nThe PART command is used to leave a specific channel. The `\u003cchannel\u003e` parameter specifies the channel to be left, and the `\u003creason\u003e` parameter provides the reason for leaving the channel.\n\n```bnf\nCommand: PASS\nParameters: \u003cpassword\u003e\n```\n\nThe PASS command is used to provide a password for the connection. The `\u003cpassword\u003e` parameter specifies the password to be used.\n\n```bnf\nCommand: PONG\nParameters: \u003cserver\u003e\n```\n\nThe PONG command is used to respond to a PING command. The `\u003cserver\u003e` parameter specifies the server that sent the PING command.\nIn our case, [LimeChat] automatically sends a PONG command after a specific amount of time.\n\n```bnf\nCommand: PRIVMSG\nParameters: \u003creceiver\u003e \u003ctext\u003e\n```\n\nThe PRIVMSG command is used to send a private message to a specific user or channel. The `\u003creceiver\u003e` parameter specifies the user or channel to whom the message is to be sent, and the `\u003ctext\u003e` parameter specifies the text of the message.\n\n```bnf\nCommand: QUIT\nParameters: [ \u003creason\u003e ]\n```\n\nThe QUIT command is used to disconnect from the server. The `\u003creason\u003e` parameter provides the reason for disconnecting from the server.\n\n```bnf\nCommand: RESTART\nParameters: None\n```\n\nThe RESTART command is used to restart the server. This command is only available to server operators.\n\n```bnf\nCommand: TOPIC\nParameters: \u003cchannel\u003e [ \u003ctopic\u003e ]\n```\n\nThe TOPIC command is used to set or retrieve the topic of a channel.\n\n```bnf\nCommand: USER\nParameters: \u003cusername\u003e \u003cmode\u003e \u003cunused\u003e \u003crealname\u003e\n```\n\nThe USER command is used to provide information about the user. The `\u003cusername\u003e` parameter specifies the username of the user, the `\u003cmode\u003e` parameter should be a numeric, and can be used to automatically set user modes when registering with the server. This parameter is a bitmask, with only 2 bits having any signification, and the `\u003crealname\u003e` parameter specifies the realname of the user.\n\n```bnf\nCommand: WALLOPS\nParameters: \u003cText to be sent\u003e\n```\n\nThe WALLOPS command is used to send a message to all currently connected users who have set the 'w' user mode for themselves.\n\n```bnf\nCommand: WHO\nParameters: \u003cname\u003e / \"0\"\n```\n\nThe WHO command is used to list all users on the server. The `\u003cname\u003e` parameter specifies the name of the user to be listed, and the \"0\" parameter is a wildcard that is used to list all users on the server and who don't have a common channel with the requesting client.\n\n```bnf\nCommand: WHOIS\nParameters: \u003cnickname\u003e [ \u003cserver\u003e ]\n```\n\nThe WHOIS command is used to query information about a specific user. The `\u003cnickname\u003e` parameter specifies the nickname of the user to be queried, and the `\u003cserver\u003e` parameter specifies the server to be queried.\n\n### _Resources_\n\n-   The [RFC 2810 Document] defines the Internet Relay Chat (IRC) protocol describing the architecture of the current IRC protocol and the role of its different components.\n-   The [RFC 2812 Document] defines the Internet Relay Chat (IRC) protocol and provides a detailed description of the messages exchanged between IRC clients and servers. Reading this document is essential to understand how the protocol works.\n-   The [RFC 2811 Document] defines the Internet Relay Chat (IRC) protocol and provides a detailed description of how channels, their characteristics and properties are managed by IRC servers\n-   The [Beej's Guide to Network Programming] is a comprehensive guide to network programming in C that covers sockets, networking protocols, and more. Although it's not specific to IRC server development, it can provide useful information about networking concepts and techniques.\n-   The [IRCd-Hybrid project] is an open-source IRC server written in C. You can study its source code to get a better understanding of how an IRC server works and how to implement one in C++98.\n\n### _Authors_\n\nThe `FT_IRC` server project was created by a team of developers from [1337], a coding school located in Morocco, Africa, that is a member of the renowned [42 Network] of coding schools. The school is also powered by the [Mohammed VI Polytechnic University (UM6P)](https://www.um6p.ma), which provides world-class resources and expertise to its students.\n\nAs a member of the [42 Network], [1337 Coding School] follows the same innovative and immersive educational model, which is based on project-based learning and peer-to-peer collaboration. This means that students are free to learn at their own pace, and are encouraged to work on real-world projects that challenge and inspire them.\n\nThe school's partnership with [UM6P] ensures that students have access to the latest technologies and tools, as well as world-class faculty members and experts in the field of computer science. This allows students to gain a comprehensive understanding of coding and computer science, while also developing the practical skills needed to succeed in the tech industry.\n\nOverall, [1337 Coding School] is a unique and innovative institution that provides an exceptional education in coding and computer science, while also preparing students for success in the rapidly-evolving tech industry.\n\nThe project was completed as part of the common core's curriculum for the school's network branch.\n\nThe following individuals contributed to the development of the project:\n\n| Name                             | Email                    |\n| -------------------------------- | ------------------------ |\n| [Achraf Maghous]                 | acmaghou@student.1337.ma |\n| [Mohammed Badr Eddine El Housni] | mel-hous@student.1337.ma |\n| [Soufiane El Marsi]              | sel-mars@student.1337.ma |\n\nEach team member worked collaboratively to ensure the project met all the requirements, and together they successfully created a fully functional IRC server that meets the mandatory and bonus parts of the project.\n\n### _Contributing_\n\nContributions to this project are welcome and encouraged. If you would like to contribute, please follow these steps:\n\n1. Fork this repository.\n2. Create a new branch with your changes: git checkout -b my-feature-branch\n3. Commit your changes: git commit -am 'Add some feature'\n4. Push the branch to your fork: git push origin my-feature-branch\n5. Create a new Pull Request and describe your changes.\n\n### _License_\n\nThis project is released under the permissive MIT License, which allows anyone to use, copy, modify, and distribute the software without any warranty. For more information about the license terms, please refer to the [LICENSE.md] file included in the project.\n\n[limechat]: https://limechat.net/mac/\n[bnf]: https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form\n[rfc 2810 document]: https://www.rfc-editor.org/rfc/rfc2810\n[rfc 2812 document]: https://www.rfc-editor.org/rfc/rfc2812\n[rfc 2811 document]: https://www.rfc-editor.org/rfc/rfc2811\n[beej's guide to network programming]: https://beej.us/guide/bgnet\n[ircd-hybrid project]: http://www.ircd-hybrid.org\n[42 network]: https://www.42network.org\n[1337]: https://www.1337.ma/en\n[1337 coding school]: https://www.1337.ma/en\n[mohammed vi polytechnic university (um6p)]: https://www.um6p.ma\n[um6p]: https://www.um6p.ma\n[achraf maghous]: https://github.com/AchrafMaghous\n[mohammed badr eddine el housni]: https://github.com/badr-7\n[soufiane el marsi]: https://github.com/soofiane262\n[license.md]: https://github.com/soofiane262/ft_irc/blob/master/LICENSE.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoofiane262%2Fft_irc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoofiane262%2Fft_irc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoofiane262%2Fft_irc/lists"}