#time #networking #rfc868 #tod #system

app phoeniceus

现代RFC868的TCP/UDP实现

4个版本

0.1.3 2024年5月10日
0.1.2 2024年5月10日
0.1.1 2024年5月9日
0.1.0 2024年5月9日

#1 in #tod

Download history 272/week @ 2024-05-06 5/week @ 2024-05-13 10/week @ 2024-05-20

每月下载 60

MIT 许可证

11KB
182 代码行

Phoeniceus

GitHub License Crates.io Version

timed-rs和RHEL(及其类似)系统中xinetd的消亡启发,对RFC868的现代实现。此实现将监听TCP、UDP或两者的混合连接类型。

项目的名称基于红翅黑bird的科学名称。 :)

配置

应用程序需要一个基于TOML的配置文件,包括以下选项

mode (string): One of "tcp", "udp" or "both"
host (string): address to bind to e.g., "127.0.0.1", "::"
port (integer): port to bind to, normally 37

示例

监听所有可用的v4和v6地址,通过端口37进行TCP和UDP连接

mode = "both"
host = "::"
port = 37

监听v4 localhost的TCP连接,通过端口1037

mode = "tcp"
host = "127.0.0.1"
port = 1037

用法

Usage: phoeniceus --config <CONFIG>

Options:
  -c, --config <CONFIG>  Path to config file for phoeniceus daemon
  -h, --help             Print help

示例

[tramage@tramage-desktop phoeniceus]$ cat tod.toml 
mode = "both"
host = "::"
port = 37

[tramage@tramage-desktop phoeniceus]$ phoeniceus -c ./tod.toml 
2024-05-09T17:05:07.507007Z  INFO phoeniceus: Listening for TCP and UDP connections on :::37

[tramage@tramage-desktop phoeniceus]$ rdate localhost -p
rdate: [localhost]      Thu May  9 13:07:19 2024

# and in the application logs...
2024-05-09T17:07:19.347900Z  INFO phoeniceus::srv: Received TCP connection from [::1]:48300
2024-05-09T17:07:19.347947Z  INFO phoeniceus::srv: Sent -370704057 as bytes to [::1]:48300

依赖关系

~6–15MB
~172K SLoC