Skip to content

enable comment of conf titles#750

Merged
ffdfgdfg merged 1 commit intoehang-io:devfrom
hellodword:patch-1
Apr 7, 2021
Merged

enable comment of conf titles#750
ffdfgdfg merged 1 commit intoehang-io:devfrom
hellodword:patch-1

Conversation

@hellodword
Copy link
Copy Markdown
Contributor

@hellodword hellodword commented Feb 14, 2021

简单处理一下可以更好地支持注释

[common]
server_addr=1.1.1.1:8024
conn_type=tcp
vkey=123

#[tcp]
#mode=tcp
#target_addr=127.0.0.1:8080

#[p2p_ssh]
#local_port=2002
#password=ssh3
#target_addr=123.206.77.88:22

否则不支持注释 title,会被匹配到 title 最后在 npc 中出错。

这只是个简单的 fix,但感觉 nps 对于 config 的解析代码这块可能需要重新考虑一下,正则太暴力了 (例如 go-ini/ini)。

很好用的工具,感谢。

@jimsmt
Copy link
Copy Markdown

jimsmt commented Apr 6, 2021

我正想提issue呢,第一次用,把默认配置里的条目注释掉了,结果启动一直报错,最后用无配置文件方式启动才行

@ffdfgdfg ffdfgdfg changed the base branch from master to dev April 7, 2021 10:39
@ffdfgdfg ffdfgdfg merged commit 9d5c3fd into ehang-io:dev Apr 7, 2021
@ffdfgdfg
Copy link
Copy Markdown
Contributor

ffdfgdfg commented Apr 7, 2021

这类配置,后续考虑yaml来处理更灵活

kirikoko1213 pushed a commit to kirikoko1213/nps that referenced this pull request Jul 26, 2022
axfinn pushed a commit to axfinn/nps that referenced this pull request Jul 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants