{"id":19638341,"url":"https://github.com/9001/r0c","last_synced_at":"2025-04-15T20:04:14.422Z","repository":{"id":57459609,"uuid":"116541460","full_name":"9001/r0c","owner":"9001","description":"retr0chat telnet server","archived":false,"fork":false,"pushed_at":"2024-07-20T18:25:44.000Z","size":957,"stargazers_count":44,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T00:41:12.929Z","etag":null,"topics":["chat-server","irc","mainframe-meme","telnet-server","vt100"],"latest_commit_sha":null,"homepage":"","language":"Python","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/9001.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2018-01-07T05:53:56.000Z","updated_at":"2025-03-07T17:40:22.000Z","dependencies_parsed_at":"2022-09-13T16:03:33.424Z","dependency_job_id":"2b535afd-7cd4-4d38-8e30-79100239b005","html_url":"https://github.com/9001/r0c","commit_stats":{"total_commits":264,"total_committers":1,"mean_commits":264.0,"dds":0.0,"last_synced_commit":"cade978170c9a70372a6273f449c517eb79b3969"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9001%2Fr0c","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9001%2Fr0c/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9001%2Fr0c/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9001%2Fr0c/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/9001","download_url":"https://codeload.github.com/9001/r0c/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248765916,"owners_count":21158296,"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":["chat-server","irc","mainframe-meme","telnet-server","vt100"],"created_at":"2024-11-11T12:38:18.397Z","updated_at":"2025-04-15T20:04:14.389Z","avatar_url":"https://github.com/9001.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `r0c` telnet server\n\n* retr0chat, irc-like chat service for superthin clients [(on PyPI)](https://pypi.org/project/r0c/)\n* MIT-Licensed, 2018-01-07, ed @ irc.rizon.net\n* **[windows telnet 360 noscope](https://ocv.me/r0c.webm)** \u003c- good video\n\n![screenshot of telnet connected to a r0c server](docs/r0c.png)\n\n* see [installation](#installation) or grab the latest release: **[r0c.py](https://github.com/9001/r0c/releases/latest/download/r0c.py)**\n\n## summary\n\nimagine being stuck on ancient gear, in the middle of nowhere, on a slow connection between machines that are even more archaic than the toaster you're trying to keep from falling apart\n\nretr0chat is the lightweight, no-dependencies, runs-anywhere solution for when life gives you lemons\n\n* tries to be irssi\n* zero dependencies on python 2.6, 2.7, 3.x\n* supports telnet, netcat, /dev/tcp, TLS clients\n* is not an irc server, but can [bridge to/from irc servers](#irc)\n* [modem-aware](https://ocv.me/r0c-2400.webm); comfortable at 1200 bps\n* fallbacks for inhumane conditions\n  * linemode\n  * no vt100 / ansi escape codes\n\n## endorsements\n\n* the german federal office for information security [does not approve](https://ocv.me/stuff/r0c-bsi.png)\n\n## compatibility\n\n* 1980: [TVI 920C](https://a.ocv.me/pub/g/nerd-stuff/r0c-tvi-920c.jpg)\n* 1987: [IBM 3151](https://a.ocv.me/pub/g/nerd-stuff/r0c-ibm-3151.jpg) (also [video](https://a.ocv.me/pub/g/nerd-stuff/r0c-ibm-3151.webm)), using gnu-screen to translate VT100 sequences\n* 1993: [windows 3.11](https://a.ocv.me/pub/g/nerd-stuff/r0c-for-workgroups.png)\n\n## features\n\nirc-like:\n* public channels with persistent history (pgup/pgdn)\n* private messages (`/msg acidburn hey`)\n* nick completion with `Tab ↹`\n* notifications (bell/visual) on hilights and PMs\n* command subset (`/nick`, `/join`, `/part`, `/names`, `/topic`, `/me`)\n* inline message coloring, see `/help`\n\ntechnical:\n* client behavior detection (echo, colors, charset, newline)\n* message input with readline-like editing (arrow-left/right, home/end, backspace)\n  * history of sent messages (arrow-up/down)\n* bandwidth-conservative (push/pop lines instead of full redraws; scroll-regions)\n* fast enough; 600 clients @ 750 msgs/sec, or 1500 cli @ 75 msg/s\n* [bridge](#irc) several irc channels from several networks into one r0c channel\n\n## windows clients\n\n* use [putty](https://the.earth.li/~sgtatham/putty/latest/w32/putty.exe) in telnet mode\n* or [the powershell client](clients/powershell.ps1)\n* or enable `Telnet Client` in control panel `-\u003e` programs `-\u003e` programs and features `-\u003e` turn windows features on or off, then press WIN+R and run `telnet r0c.int`\n\nputty is the best option;\n* the powershell client is OK and no longer spammy as of windows 10.0.15063 (win10 1703 / LTSC)\n* windows-telnet has a bug (since win7) where [non-ascii letters occasionally render but usually dont](https://ocv.me/stuff/win10-telnet.webm)\n  * this is due to a buffer overflow in `telnet.exe`, so r0c will apply a rate-limit to avoid it\n  * looks like messages larger than 512 bytes end up messing with the unicode glyphs area? or something\n\n## linux clients\n\nmost to least recommended\n\n| client | example |\n| :---   | :---    |\n| telnet | `telnet r0c.int` |\n| socat  | `socat -,raw,echo=0 tcp:r0c.int:531` |\n| bash   | [mostly internals](clients/bash.sh) |\n| netcat | `nc r0c.int 531` |\n\nyou can even `exec 147\u003c\u003e/dev/tcp/r0c.int/531;cat\u003c\u0026147\u0026while IFS= read -rn1 x;do [ -z \"$x\" ]\u0026\u0026x=$'\\n';printf %s \"$x\"\u003e\u0026147;done` (disconnect using `exec 147\u003c\u0026-; killall cat #sorry`)\n\n## tls clients\n\nif you enable TLS with `-tpt 2424` (telnet) and/or `-tpn 1515` (netcat) you can connect to r0c with TLS encryption using any of the following:\n\n* `telnet-ssl -zssl -zsecure -zcacert=r0c.crt r0c.int 2424`\n* `socat -,raw,echo=0 openssl:r0c.int:1515,cafile=cert.crt`\n* `socat -,raw,echo=0 openssl:127.0.0.1:1515,verify=0`\n* `stty -icanon; ncat --ssl --ssl-trustfile r0c.crt -v r0c.int 1515`\n* `stty -icanon; openssl s_client -CAfile ~/.r0c/cert.crt -nbio -connect r0c.int:1515`\n* windows: [powershell client](https://github.com/9001/r0c/blob/master/clients/powershell.ps1) with port `+1515` (the `+` enables TLS)\n  * powershell does not verify certificate; the other clients do\n\nthe powershell client and bash client comes bundled with the server; see [protips](#protips)\n\n## connecting from a web browser\n\n![screenshot of chrome connecting to r0c through ttyd](docs/r0cc.png)\n\noh you betcha! see the [webtty readme](webtty/)\n\n\n# installation\n\njust run **[r0c.py](https://github.com/9001/r0c/releases/latest/download/r0c.py)** and that's it (usually)\n\n* or install through pypi (python3 only): `python3 -m pip install --user -U r0c`\n\nyou can run it as a service so it autostarts on boot:\n\n* on most linux distros: [systemd service](docs/systemd/r0c.service) (automatically does port-forwarding)\n* on alpine / gentoo: [openrc service](docs/openrc/r0c)\n* on windows: [nssm](https://nssm.cc/) probably\n\n## irc\n\nif you want to connect your r0c instance to an irc network and bridge channels between them, you can do that:\n\n![screenshot of a r0c channel being bridged to an irc channel](docs/r0c-irc.png)\n\n```bash\npython3 r0c.py --ircn a,127.0.0.1,6667,r0c --ircb a,chat,g\n```\n\nrun that command to start r0c with irc bridging enabled; r0c will then connect to an irc server (which we nicknamed `a`) on `127.0.0.1:6667` with the irc-nick `r0c` and bridge the irc-channel `#chat` with the r0c-channel `#g`\n\nif you then start an irc server locally, for example [miniircd](https://github.com/jrosdahl/miniircd/blob/master/miniircd) by running `python3 miniircd --verbose` then you're all set, people can now join r0c by connecting via irc\n\nto bridge additional channels on the same network, add more `--ircb` args, for example `--ircb a,tech,tech` like in the screenshot, and optionally add more networks with `--ircn`\n\n## firewall rules\n\nskip this section if:\n* you are using the systemd service\n* or you are running as root and do not have a firewall\n* or you're on windows\n\nif you're using firewalld, and just want to open up the high ports (not 23 and 531) then this is probably enough:\n\n```bash\nfirewall-cmd --permanent --add-port={23,531,2323,1531,2424,1515,8023}/tcp\nfirewall-cmd --reload\n```\n\nbut having to specify the port when connecting is lame so consider the folllowing --\n\ntelnet uses port 23 by default, so on the server you'll want to port-forward `23` to `2323` (and `531` to `1531` for plaintext):\n\n```bash\niptables -A INPUT -p tcp --dport 23 -m state --state NEW -j ACCEPT\niptables -A INPUT -p tcp --dport 531 -m state --state NEW -j ACCEPT\niptables -A INPUT -p tcp --dport 2323 -m state --state NEW -j ACCEPT\niptables -A INPUT -p tcp --dport 1531 -m state --state NEW -j ACCEPT\niptables -A INPUT -p tcp --dport 2424 -m state --state NEW -j ACCEPT  # tls telnet\niptables -A INPUT -p tcp --dport 1515 -m state --state NEW -j ACCEPT  # tls netcat\niptables -A INPUT -p tcp --dport 8023 -m state --state NEW -j ACCEPT  # http/ttyd\niptables -t nat -A PREROUTING -i eth0 -p tcp --dport 23 -j REDIRECT --to-port 2323\niptables -t nat -A PREROUTING -i eth0 -p tcp --dport 531 -j REDIRECT --to-port 1531\n```\n\n(you'll have to do this on every reboot)\n\n\n\n# documentation\n\nnot really but there is a [list of commands](docs/help-commands.md) and a [list of hotkeys](docs/help-hotkeys.md), and also [UI demystified](docs/help-ui.md)\n\n## protips\n\ntry the following commands and hotkeys after connecting:\n\n* `/cy` enables colored nicknames\n* `/b3` (max cowbell) beeps on every message\n* `/v` or `ctrl-n` hides names and makes wordwrap more obvious; good for viewing a wall of text that somebody pasted\n* `CTRL-L` or `/r` if rendering breaks\n\n## other surprises\n\n* when running **[r0c.py](https://github.com/9001/r0c/releases/latest/download/r0c.py)** it will extract a few bundled clients for your convenience (powershell and bash); look for the `[SFX] sfxdir: /tmp/pe-r0c.1000` message during startup, they'll be in a `clients` subfolder over there\n\n  * if you installed r0c through `pip` instead then the clients will be somewhere crazy like `C:\\Users\\ed\\AppData\\Roaming\\Python\\share\\doc\\r0c\\clients\\powershell.ps1` or `/home/ed/.local/share/doc/r0c/clients/powershell.ps1`, good luck!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F9001%2Fr0c","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F9001%2Fr0c","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F9001%2Fr0c/lists"}