zhboner / realm

A network relay tool
MIT License
1.48k stars 279 forks source link

配置文件运行失败 #120

Closed Omoinemie closed 8 months ago

Omoinemie commented 8 months ago

【运行日志】: root@sh-debian:/app/realm# ./realm -c config.toml fd: soft=1048576, hard=1048576 thread 'main' panicked at src/conf/mod.rs:86:23: failed to parse config.toml: parse as toml: TOML parse error at line 1, column 1 | 1 | [log] | ^ missing field endpoints ; parse as json: expected value at line 1 column 2; parse as legacy: expected value at line 1 column 2 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

【配置文件】: [log] level = "warn" output = "/app/realm/logs.log"

[network] no_tcp = false use_udp = true

[[HTTP]] listen = "0.0.0.0:80" remote = "10.0.0.2:80"

[[HTTPS]] listen = "0.0.0.0:443" remote = "10.0.0.2:443"

zephyrchien commented 8 months ago

注意看报错信息,缺少[[endpoints]]

failed to parse config.toml: parse as toml: TOML parse error at line 1, column 1
|
1 | [log]
| ^
missing field endpoints
; parse as json: expected value at line 1 column 2; parse as legacy: expected value at line 1 column 2
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

这里你需要把[[HTTP]][[HTTPS]] 都改成 [[endpoints]]

配置项的名字是固定的,如果需要做标记的话可以用toml的注释 #