docs: drop frp self-comparison in core references
- go.mod/main.go/config.go/sample/CHANGELOG: 移除 类 frp/去中心化 frp 本体/像 frp 类比 - 保留 ExternalService 中真实的 frp_server 外部穿透服务(客观功能,非自比)
This commit is contained in:
+4
-4
@@ -10,8 +10,8 @@ import (
|
||||
"github.com/BurntSushi/toml"
|
||||
)
|
||||
|
||||
// Config 是 meshray-core 独立运行(类 frp 风格)的配置文件结构。
|
||||
// 支持 TOML(默认,类 frp)与 JSON 两种格式,按文件扩展名自动选择解码器。
|
||||
// Config 是 meshray-core 独立运行的配置文件结构。
|
||||
// 支持 TOML(默认)与 JSON 两种格式,按文件扩展名自动选择解码器。
|
||||
//
|
||||
// TOML 示例:
|
||||
//
|
||||
@@ -70,7 +70,7 @@ type ICEConf struct {
|
||||
}
|
||||
|
||||
// loadConfig 读取并解析配置文件:按扩展名自动选择 TOML 或 JSON 解码器。
|
||||
// 默认且推荐 TOML(类 frp);旧 .json 配置仍可继续使用。
|
||||
// 默认且推荐 TOML;旧 .json 配置仍可继续使用。
|
||||
func loadConfig(path string) (*Config, error) {
|
||||
data, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
@@ -85,7 +85,7 @@ func loadConfig(path string) (*Config, error) {
|
||||
ext := filepath.Ext(lower)
|
||||
switch ext {
|
||||
case ".toml", ".conf":
|
||||
// TOML:与 frp 风格一致
|
||||
// TOML:默认配置格式
|
||||
if err := toml.Unmarshal(data, cfg); err != nil {
|
||||
return nil, fmt.Errorf("解析 TOML 配置 %s 失败: %w", path, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user