feat: 实现依据 InboundSetting 和 OutboundSetting 生成配置的功能.
This commit is contained in:
@@ -20,11 +20,13 @@ public abstract class BaseOutboundSetting
|
||||
/// <summary>
|
||||
/// 发送出站数据所使用的网卡地址.
|
||||
/// </summary>
|
||||
public string BindAddress { get; init; } = "0.0.0.0";
|
||||
public string? BindAddress { get; init; }
|
||||
/// <summary>
|
||||
/// 出站代理协议类型.
|
||||
/// </summary>
|
||||
public OutboundProtocolType Protocol { get; init; }
|
||||
|
||||
public string? Address { get; init; }
|
||||
|
||||
public BaseStreamSetting StreamSetting { get; init; } = new RawStreamSetting();
|
||||
|
||||
@@ -41,12 +43,16 @@ public abstract class BaseOutboundSetting
|
||||
{
|
||||
var root = new JsonObject
|
||||
{
|
||||
{ "sendThrough", BindAddress },
|
||||
{ "protocol", Protocol.ToString().ToLower() },
|
||||
{ "tag", GetTag() },
|
||||
{ "settings", GetProtocolSetting() }
|
||||
};
|
||||
|
||||
if (!string.IsNullOrEmpty(BindAddress))
|
||||
{
|
||||
root.Add("sendThrough", BindAddress);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(NextOutboundTag))
|
||||
{
|
||||
root.Add("proxySettings", new JsonObject
|
||||
|
||||
Reference in New Issue
Block a user