refactor: 优化配置代码结构.
This commit is contained in:
@@ -17,6 +17,11 @@ public class ShadowSocksOutboundSetting : BaseOutboundSetting
|
||||
public required string Password { get; init; }
|
||||
public bool EnableUdpOverTcp { get; init; } = false;
|
||||
public uint? UdpOverTcpVersion { get; init; } = null;
|
||||
|
||||
public ShadowSocksOutboundSetting()
|
||||
{
|
||||
Protocol = OutboundProtocolType.Shadowsocks;
|
||||
}
|
||||
|
||||
public override string GetTag()
|
||||
{
|
||||
@@ -27,13 +32,15 @@ public class ShadowSocksOutboundSetting : BaseOutboundSetting
|
||||
{
|
||||
var root = new JsonObject();
|
||||
|
||||
var setting = new JsonObject();
|
||||
setting.Add("address", Address);
|
||||
setting.Add("port", Port);
|
||||
setting.Add("method", Method);
|
||||
setting.Add("password", Password);
|
||||
var setting = new JsonObject
|
||||
{
|
||||
{ "address", Address },
|
||||
{ "port", Port },
|
||||
{ "method", Method },
|
||||
{ "password", Password },
|
||||
{ "uot", EnableUdpOverTcp }
|
||||
};
|
||||
|
||||
setting.Add("uot", EnableUdpOverTcp);
|
||||
if (EnableUdpOverTcp)
|
||||
{
|
||||
setting.Add("UoTVersion", UdpOverTcpVersion);
|
||||
|
||||
Reference in New Issue
Block a user