Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable comment of conf titles #750

Merged
merged 1 commit into from
Apr 7, 2021
Merged

enable comment of conf titles #750

merged 1 commit into from
Apr 7, 2021

Conversation

hellodword
Copy link
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

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
Collaborator

ffdfgdfg commented Apr 7, 2021

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

kiririx pushed a commit to kiririx/nps that referenced this pull request Jul 26, 2022
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