{"id":17021312,"url":"https://github.com/uliwitness/eleven","last_synced_at":"2025-04-12T10:13:45.785Z","repository":{"id":136633804,"uuid":"26038766","full_name":"uliwitness/eleven","owner":"uliwitness","description":"A simple, modular, BSD-socket-based C++ chat server and client. Intended as a foundation for embedding in other apps and building actual chat systems on top of, or network communication for other client/server systems.","archived":false,"fork":false,"pushed_at":"2015-11-01T17:38:30.000Z","size":524,"stargazers_count":6,"open_issues_count":7,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-12T10:13:37.813Z","etag":null,"topics":["experiment","interconnect-game","work-in-progress"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uliwitness.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-01T01:36:27.000Z","updated_at":"2023-01-11T05:15:20.000Z","dependencies_parsed_at":"2023-03-13T15:45:58.474Z","dependency_job_id":null,"html_url":"https://github.com/uliwitness/eleven","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/uliwitness%2Feleven","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uliwitness%2Feleven/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uliwitness%2Feleven/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uliwitness%2Feleven/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uliwitness","download_url":"https://codeload.github.com/uliwitness/eleven/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248550633,"owners_count":21122934,"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":["experiment","interconnect-game","work-in-progress"],"created_at":"2024-10-14T07:07:22.249Z","updated_at":"2025-04-12T10:13:45.757Z","avatar_url":"https://github.com/uliwitness.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"A small, modular, C++, BSD-socket-based chat client and server, intended for use in\nprojects that want to embed chat or chat-like functionality.\n\n\nWarning\n-------\n\nIf you want to use this in production, you *must* obtain your own certificates (e.g.\nby buying them from your web hoster). The included certificates are up for everyone\non Github and can therefore be used by anyone to spoof messages. They are merely\nincluded as a convenience for those trying out the code.\n\nFor deployment, you should set up a settings folder containing your certificates and\naccounts and pass its path as the first parameter to the server/client.\n\n\nUsage\n-----\n\nThe app includes a simple test \"client\" that you can modify to try things out. By\ndefault it will simply perform a few commands and display the replies returned by\nthose.\n\nThe example server is reasonably full-featured and implements a protocol vaguely\nreminiscent of IRC. There is a \"/login admin eleven\" command to log you in\n(the example is the default user name and password in a fresh build). A \"/bye\" command\nto end your session. A \"/join myChannel\" command for creating and listening to a\nchannel. A \"/leave myChannel\" command to stop listening to a channel, commands to\ncreate new users, ban users from a channel or even from just logging in, etc.\n\nSee the comments on each line that registers a handler in the example server's\nmain.cpp file for all commands currently supported.\n\n\nInstallation\n------------\n\nFor TLS support (i.e. so user passwords don't cross the line in plain text), you need\nto build LibreSSL's libtls. The project has a \"libressl\" target that does that for you,\nbut you may need to install automake, autoconf and libtool, e.g. using Homebrew \n\n\tbrew install autoconf automake libtool\n\nas that is what the libTLS build scripts use.\n\n\nCommand handlers\n----------------\n\nThe chat server class is stupid by default and does nothing. To make it do something, you\ngive it C++ lambdas (aka \"blocks\" or \"handlers\"). Each line received has its first word\nextracted (everything up to the first space, tab or line break), and matched against the\nstrings for which handlers have been registered. If none of these matches, it looks for a\nhandler registered for \"*\" and calls that.\n\nThese handlers get handed a session object with which they can send a reply, and\nthe entire line (including the first word) that the client sent. They can now\ndecide how to react.\n\nThe same principle applies to the client.\n\n\nTypes of users\n--------------\n\nThere are three kinds of users. \"Normal\" users can simply join/create channels and chat.\n\"Moderator\" users can kick users from channels, block and retire users from logging in,\nor delete a user, as long as the other user is a \"Normal\" user. \"Owner\" users can create\nnew accounts on the server, and designate other accounts as moderators or owners. Owners\ncan also do all the things moderators can.\n\nWhen you build the example server, the Xcode project will copy a default accounts.txt\nfile next to the application that defines one user named \"admin\" with password \"eleven\".\nThis user is an \"Owner\" and can be used to create other users etc.\n\n\nFormat of messages\n------------------\n\nWhile messages sent from server to client can really have any format you wish (they can\neven consist of binary data), the defaults have a strict format that will make it easier\nto parse for clients and display them in a graphical fashion or localize them. All replies\nfrom the server start with a reply code prefixed with a slash, which is the first word\nof the first line. If this code starts with an exclamation mark right after the slash,\nit indicates an error occurred (e.g. a message may start with \"/!not_logged_in\" for \"you are\nnot logged in\").\n\nThen, messages usually contain one or more words (separated by spaces) indicating additional\nmetadata like the channel on which a message was sent, or the user name of the user that\noriginally sent the message. The rest of the line is usually the actual message sent, if any.\n\nSo if you were using Eleven to implement, say, the communications mechanism in an MMORPG,\nthe game the user downloads would be a client, and could choose to display all messages that\nstart with \"/!\" in modal error alert panel. It could display messages that start with\n\"/note\" as text subtitles at the top of the game screen, and messages that start\nwith \"/joined_channel\" could be meant to be the area in which the user is now playing.\nMessages that start with \"/message\" (Actual text a user types) can even be shown as\nspeech balloons over the corresponding character's head, as they include channel and\nuser name.\n\nThe server can even ask on behalf of the player to have the player join or leave a chatroom,\ne.g. when the player moves from one map to the next, so that chat will show up in the current\nroom for all other players who are there with her.\n\n\nLicense\n-------\n\n    Copyright 2014 by Uli Kusterer.\n\n    This software is provided 'as-is', without any express or implied\n    warranty. In no event will the authors be held liable for any damages\n    arising from the use of this software.\n\n    Permission is granted to anyone to use this software for any purpose,\n    including commercial applications, and to alter it and redistribute it\n    freely, subject to the following restrictions:\n\n    1. The origin of this software must not be misrepresented; you must not\n    claim that you wrote the original software. If you use this software\n    in a product, an acknowledgment in the product documentation would be\n    appreciated but is not required.\n\n    2. Altered source versions must be plainly marked as such, and must not be\n    misrepresented as being the original software.\n\n    3. This notice may not be removed or altered from any source\n    distribution.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuliwitness%2Feleven","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuliwitness%2Feleven","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuliwitness%2Feleven/lists"}