mirror of
https://github.com/2dust/v2rayN.git
synced 2026-11-19 10:55:00 +03:00
Compare commits
10 Commits
7.23.3
...
6f50206606
| Author | SHA1 | Date | |
|---|---|---|---|
| 6f50206606 | |||
| 1de83f96ed | |||
| 994bc1ca6a | |||
| 3ca49dd9db | |||
| a0bd8f9934 | |||
| 88d59488fd | |||
| 2c70b018ce | |||
| b6ab428dfc | |||
| 45ab7503e3 | |||
| 1768b4a7ee |
@@ -83,6 +83,11 @@ jobs:
|
|||||||
working-directory: ./v2rayN
|
working-directory: ./v2rayN
|
||||||
run: dotnet publish ./AmazTool/AmazTool.csproj -c Release -r $RID -p:SelfContained=true -p:PublishTrimmed=true $ExtOpt -o $Output
|
run: dotnet publish ./AmazTool/AmazTool.csproj -c Release -r $RID -p:SelfContained=true -p:PublishTrimmed=true $ExtOpt -o $Output
|
||||||
|
|
||||||
|
- name: Remove Debug Symbols
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
find ${{ matrix.arch }} -type f -name '*.pdb' -delete
|
||||||
|
|
||||||
- name: Upload build artifacts
|
- name: Upload build artifacts
|
||||||
uses: actions/upload-artifact@v7.0.1
|
uses: actions/upload-artifact@v7.0.1
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -23,8 +23,13 @@ jobs:
|
|||||||
|
|
||||||
$targetRelease = $github | Where-Object -Property prerelease -match 'False' | Select -First 1
|
$targetRelease = $github | Where-Object -Property prerelease -match 'False' | Select -First 1
|
||||||
|
|
||||||
$x64InstallerUrl = $targetRelease | Select -ExpandProperty assets -First 1 | Where-Object -Property name -match 'v2rayN-windows-64\.zip' | Select -ExpandProperty browser_download_url
|
$assets = $targetRelease | Select -ExpandProperty assets -First 1
|
||||||
$arm64InstallerUrl = $targetRelease | Select -ExpandProperty assets -First 1 | Where-Object -Property name -match 'v2rayN-windows-arm64\.zip' | Select -ExpandProperty browser_download_url
|
$x64InstallerUrl = $assets | Where-Object { $_.name -eq 'v2rayN-windows-64.zip' } | Select -ExpandProperty browser_download_url
|
||||||
|
$arm64InstallerUrl = $assets | Where-Object { $_.name -eq 'v2rayN-windows-arm64.zip' } | Select -ExpandProperty browser_download_url
|
||||||
|
|
||||||
|
if (-not $x64InstallerUrl -or -not $arm64InstallerUrl) {
|
||||||
|
throw "Could not find required installers in release assets."
|
||||||
|
}
|
||||||
|
|
||||||
$ver = $targetRelease.tag_name
|
$ver = $targetRelease.tag_name
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<Project>
|
<Project>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Version>7.23.3</Version>
|
<Version>7.23.4</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
|||||||
@@ -5,14 +5,14 @@
|
|||||||
<CentralPackageVersionOverrideEnabled>false</CentralPackageVersionOverrideEnabled>
|
<CentralPackageVersionOverrideEnabled>false</CentralPackageVersionOverrideEnabled>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageVersion Include="Avalonia.AvaloniaEdit" Version="11.4.1" />
|
<PackageVersion Include="Avalonia.AvaloniaEdit" Version="12.0.0" />
|
||||||
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="11.3.13" />
|
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="12.1.0" />
|
||||||
<PackageVersion Include="Avalonia.Desktop" Version="11.3.18" />
|
<PackageVersion Include="Avalonia.Desktop" Version="12.1.0" />
|
||||||
<PackageVersion Include="Avalonia.Diagnostics" Version="11.3.18" />
|
<PackageVersion Include="AvaloniaUI.DiagnosticsSupport" Version="2.2.3" />
|
||||||
<PackageVersion Include="AwesomeAssertions" Version="9.4.0" />
|
<PackageVersion Include="AwesomeAssertions" Version="9.4.0" />
|
||||||
<PackageVersion Include="DialogHost.Avalonia" Version="0.11.0" />
|
<PackageVersion Include="DialogHost.Avalonia" Version="0.12.2" />
|
||||||
<PackageVersion Include="IPNetwork2" Version="4.3.0" />
|
<PackageVersion Include="IPNetwork2" Version="4.3.0" />
|
||||||
<PackageVersion Include="ReactiveUI.Avalonia" Version="11.4.13" />
|
<PackageVersion Include="ReactiveUI.Avalonia" Version="12.0.3" />
|
||||||
<PackageVersion Include="CliWrap" Version="3.10.2" />
|
<PackageVersion Include="CliWrap" Version="3.10.2" />
|
||||||
<PackageVersion Include="Downloader" Version="5.9.0" />
|
<PackageVersion Include="Downloader" Version="5.9.0" />
|
||||||
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.7.0" />
|
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.7.0" />
|
||||||
@@ -22,9 +22,9 @@
|
|||||||
<PackageVersion Include="ReactiveUI" Version="23.2.28" />
|
<PackageVersion Include="ReactiveUI" Version="23.2.28" />
|
||||||
<PackageVersion Include="ReactiveUI.Fody" Version="19.5.41" />
|
<PackageVersion Include="ReactiveUI.Fody" Version="19.5.41" />
|
||||||
<PackageVersion Include="ReactiveUI.WPF" Version="23.2.28" />
|
<PackageVersion Include="ReactiveUI.WPF" Version="23.2.28" />
|
||||||
<PackageVersion Include="Semi.Avalonia" Version="11.3.14" />
|
<PackageVersion Include="Semi.Avalonia" Version="12.1.0" />
|
||||||
<PackageVersion Include="Semi.Avalonia.AvaloniaEdit" Version="11.2.0.2" />
|
<PackageVersion Include="Semi.Avalonia.AvaloniaEdit" Version="12.0.0" />
|
||||||
<PackageVersion Include="Semi.Avalonia.DataGrid" Version="11.3.7.3" />
|
<PackageVersion Include="Semi.Avalonia.DataGrid" Version="12.1.0" />
|
||||||
<PackageVersion Include="NLog" Version="6.1.3" />
|
<PackageVersion Include="NLog" Version="6.1.3" />
|
||||||
<PackageVersion Include="sqlite-net-e" Version="1.11.0" />
|
<PackageVersion Include="sqlite-net-e" Version="1.11.0" />
|
||||||
<PackageVersion Include="Repobot.SQLite.Unofficial" Version="3.53.3" />
|
<PackageVersion Include="Repobot.SQLite.Unofficial" Version="3.53.3" />
|
||||||
|
|||||||
@@ -130,6 +130,25 @@ internal static class CoreConfigTestFactory
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static ProfileItem CreateHttpNode(ECoreType coreType, string indexId = "node-http-1",
|
||||||
|
string remarks = "demo-http")
|
||||||
|
{
|
||||||
|
return new ProfileItem
|
||||||
|
{
|
||||||
|
IndexId = indexId,
|
||||||
|
ConfigType = EConfigType.HTTP,
|
||||||
|
CoreType = coreType,
|
||||||
|
Remarks = remarks,
|
||||||
|
Address = "proxy.example.com",
|
||||||
|
Port = 8080,
|
||||||
|
Password = "pass",
|
||||||
|
Username = "user",
|
||||||
|
Network = nameof(ETransport.raw),
|
||||||
|
StreamSecurity = string.Empty,
|
||||||
|
Subid = string.Empty,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
public static ProfileItem CreatePolicyGroupNode(ECoreType coreType, string indexId, string remarks,
|
public static ProfileItem CreatePolicyGroupNode(ECoreType coreType, string indexId, string remarks,
|
||||||
IEnumerable<string> childIndexIds)
|
IEnumerable<string> childIndexIds)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -28,6 +28,39 @@ public class CoreConfigV2rayServiceTests
|
|||||||
v2rayConfig.inbounds.Should().Contain(i => i.protocol == nameof(EInboundProtocol.mixed));
|
v2rayConfig.inbounds.Should().Contain(i => i.protocol == nameof(EInboundProtocol.mixed));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void GenerateClientConfigContent_HttpOutbound_ShouldEmitHeadersInSettings()
|
||||||
|
{
|
||||||
|
var config = CoreConfigTestFactory.CreateConfig(ECoreType.Xray);
|
||||||
|
CoreConfigTestFactory.BindAppManagerConfig(config);
|
||||||
|
var node = CoreConfigTestFactory.CreateHttpNode(ECoreType.Xray);
|
||||||
|
node.SetProtocolExtra(node.GetProtocolExtra() with
|
||||||
|
{
|
||||||
|
HttpHeaders = "{\"User-Agent\":\"v2rayN\",\"Set-Cookie\":[\"a=1\",\"b=2\"]}",
|
||||||
|
});
|
||||||
|
var context = CoreConfigTestFactory.CreateContext(config, node, ECoreType.Xray);
|
||||||
|
|
||||||
|
var result = new CoreConfigV2rayService(context).GenerateClientConfigContent();
|
||||||
|
|
||||||
|
result.Success.Should().BeTrue();
|
||||||
|
var cfg = JsonUtils.Deserialize<V2rayConfig>(result.Data!.ToString())!;
|
||||||
|
var outbound = cfg.outbounds.First(o => o.tag == Global.ProxyTag && o.protocol == "http");
|
||||||
|
|
||||||
|
outbound.settings.address?.ToString().Should().Be("proxy.example.com");
|
||||||
|
outbound.settings.port.Should().Be(8080);
|
||||||
|
outbound.settings.user.Should().Be("user");
|
||||||
|
outbound.settings.pass.Should().Be("pass");
|
||||||
|
outbound.settings.level.Should().Be(1);
|
||||||
|
outbound.settings.headers.Should().NotBeNull();
|
||||||
|
var headers = JsonUtils.ParseJson(outbound.settings.headers.ToString());
|
||||||
|
headers["User-Agent"]!.GetValue<string>().Should().Be("v2rayN");
|
||||||
|
headers["Set-Cookie"]!.AsArray()
|
||||||
|
.Select(item => item!.GetValue<string>())
|
||||||
|
.Should().Equal("a=1", "b=2");
|
||||||
|
outbound.settings.servers.Should().BeNull();
|
||||||
|
outbound.settings.vnext.Should().BeNull();
|
||||||
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void GenerateClientConfigContent_PolicyGroup_ShouldExpandChildrenAndBuildBalancer()
|
public void GenerateClientConfigContent_PolicyGroup_ShouldExpandChildrenAndBuildBalancer()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -288,6 +288,7 @@ public class CertPemManager
|
|||||||
collection.ImportFromPem(pemText);
|
collection.ImportFromPem(pemText);
|
||||||
return collection;
|
return collection;
|
||||||
});
|
});
|
||||||
|
|
||||||
private static readonly Lazy<X509Certificate2Collection> _mozillaRootCerts = new(() =>
|
private static readonly Lazy<X509Certificate2Collection> _mozillaRootCerts = new(() =>
|
||||||
{
|
{
|
||||||
var pemText = EmbedUtils.GetEmbedText(Global.MozillaRootCertFileName);
|
var pemText = EmbedUtils.GetEmbedText(Global.MozillaRootCertFileName);
|
||||||
@@ -295,6 +296,7 @@ public class CertPemManager
|
|||||||
collection.ImportFromPem(pemText);
|
collection.ImportFromPem(pemText);
|
||||||
return collection;
|
return collection;
|
||||||
});
|
});
|
||||||
|
|
||||||
private X509Certificate2Collection BuildTrustedCertificateCollection()
|
private X509Certificate2Collection BuildTrustedCertificateCollection()
|
||||||
{
|
{
|
||||||
if (_config.GuiItem.RootCertProvider == Global.ChromeRootProvider)
|
if (_config.GuiItem.RootCertProvider == Global.ChromeRootProvider)
|
||||||
|
|||||||
@@ -8,8 +8,10 @@ public class CoreManager
|
|||||||
private static readonly Lazy<CoreManager> _instance = new(() => new());
|
private static readonly Lazy<CoreManager> _instance = new(() => new());
|
||||||
public static CoreManager Instance => _instance.Value;
|
public static CoreManager Instance => _instance.Value;
|
||||||
private Config _config;
|
private Config _config;
|
||||||
|
|
||||||
[SupportedOSPlatform("windows")]
|
[SupportedOSPlatform("windows")]
|
||||||
private WindowsJobService? _processJob;
|
private WindowsJobService? _processJob;
|
||||||
|
|
||||||
private ProcessService? _processService;
|
private ProcessService? _processService;
|
||||||
private ProcessService? _processPreService;
|
private ProcessService? _processPreService;
|
||||||
private bool _linuxSudo = false;
|
private bool _linuxSudo = false;
|
||||||
|
|||||||
@@ -103,6 +103,7 @@ public class UIItem
|
|||||||
public bool MacOSShowInDock { get; set; }
|
public bool MacOSShowInDock { get; set; }
|
||||||
public List<ColumnItem> MainColumnItem { get; set; }
|
public List<ColumnItem> MainColumnItem { get; set; }
|
||||||
public List<WindowSizeItem> WindowSizeItem { get; set; }
|
public List<WindowSizeItem> WindowSizeItem { get; set; }
|
||||||
|
public bool HideColumnIpInfo { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
|
|||||||
@@ -146,6 +146,16 @@ public class Outboundsettings4Ray
|
|||||||
|
|
||||||
public int? port { get; set; }
|
public int? port { get; set; }
|
||||||
|
|
||||||
|
public string? user { get; set; }
|
||||||
|
|
||||||
|
public string? pass { get; set; }
|
||||||
|
|
||||||
|
public int? level { get; set; }
|
||||||
|
|
||||||
|
public string? email { get; set; }
|
||||||
|
|
||||||
|
public object? headers { get; set; }
|
||||||
|
|
||||||
public List<WireguardPeer4Ray>? peers { get; set; }
|
public List<WireguardPeer4Ray>? peers { get; set; }
|
||||||
|
|
||||||
public bool? noKernelTun { get; set; }
|
public bool? noKernelTun { get; set; }
|
||||||
@@ -276,7 +286,6 @@ public class BalancersItem4Ray
|
|||||||
public List<string>? selector { get; set; }
|
public List<string>? selector { get; set; }
|
||||||
public BalancersStrategy4Ray? strategy { get; set; }
|
public BalancersStrategy4Ray? strategy { get; set; }
|
||||||
public string? tag { get; set; }
|
public string? tag { get; set; }
|
||||||
public string? fallbackTag { get; set; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class BalancersStrategy4Ray
|
public class BalancersStrategy4Ray
|
||||||
|
|||||||
@@ -5,6 +5,9 @@ public record ProtocolExtraItem
|
|||||||
public bool? Uot { get; init; }
|
public bool? Uot { get; init; }
|
||||||
public string? CongestionControl { get; init; }
|
public string? CongestionControl { get; init; }
|
||||||
|
|
||||||
|
// http outbound
|
||||||
|
public string? HttpHeaders { get; init; }
|
||||||
|
|
||||||
// vmess
|
// vmess
|
||||||
public string? AlterId { get; init; }
|
public string? AlterId { get; init; }
|
||||||
public string? VmessSecurity { get; init; }
|
public string? VmessSecurity { get; init; }
|
||||||
|
|||||||
Generated
+27
@@ -321,6 +321,15 @@ namespace ServiceLib.Resx {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Please enter valid HTTP request headers JSON. 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string InvalidHttpOutboundHeaders {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("InvalidHttpOutboundHeaders", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Invalid Realm URL. 的本地化字符串。
|
/// 查找类似 Invalid Realm URL. 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -3240,6 +3249,15 @@ namespace ServiceLib.Resx {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 HTTP headers 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string TbHttpOutboundHeaders {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("TbHttpOutboundHeaders", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Realm URL 的本地化字符串。
|
/// 查找类似 Realm URL 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -4986,6 +5004,15 @@ namespace ServiceLib.Resx {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Custom HTTP outbound request headers as a JSON object with string or string array values. 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string TipHttpOutboundHeaders {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("TipHttpOutboundHeaders", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 *Default value raw 的本地化字符串。
|
/// 查找类似 *Default value raw 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -1044,6 +1044,12 @@
|
|||||||
<data name="TbHeaderType8" xml:space="preserve">
|
<data name="TbHeaderType8" xml:space="preserve">
|
||||||
<value>Congestion control</value>
|
<value>Congestion control</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="TbHttpOutboundHeaders" xml:space="preserve">
|
||||||
|
<value>HTTP headers</value>
|
||||||
|
</data>
|
||||||
|
<data name="TipHttpOutboundHeaders" xml:space="preserve">
|
||||||
|
<value>Custom HTTP outbound request headers as a JSON object with string or string array values.</value>
|
||||||
|
</data>
|
||||||
<data name="LvPrevProfile" xml:space="preserve">
|
<data name="LvPrevProfile" xml:space="preserve">
|
||||||
<value>Previous proxy remarks</value>
|
<value>Previous proxy remarks</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -1806,6 +1812,9 @@ The "Get Certificate" action may fail if a self-signed certificate is used or if
|
|||||||
<data name="InvalidHy2RealmUrl" xml:space="preserve">
|
<data name="InvalidHy2RealmUrl" xml:space="preserve">
|
||||||
<value>Invalid Realm URL.</value>
|
<value>Invalid Realm URL.</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="InvalidHttpOutboundHeaders" xml:space="preserve">
|
||||||
|
<value>Please enter valid HTTP request headers JSON.</value>
|
||||||
|
</data>
|
||||||
<data name="TbHy2RealmUrlTip" xml:space="preserve">
|
<data name="TbHy2RealmUrlTip" xml:space="preserve">
|
||||||
<value>Format: realm://<token>@<rendezvous-host>[:port]/<realm-name>?stun=<stun-host>[:port]</value>
|
<value>Format: realm://<token>@<rendezvous-host>[:port]/<realm-name>?stun=<stun-host>[:port]</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -1041,6 +1041,12 @@
|
|||||||
<data name="TbHeaderType8" xml:space="preserve">
|
<data name="TbHeaderType8" xml:space="preserve">
|
||||||
<value>拥塞控制算法</value>
|
<value>拥塞控制算法</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="TbHttpOutboundHeaders" xml:space="preserve">
|
||||||
|
<value>HTTP 请求头</value>
|
||||||
|
</data>
|
||||||
|
<data name="TipHttpOutboundHeaders" xml:space="preserve">
|
||||||
|
<value>自定义 HTTP 出站请求头,请输入值为字符串或字符串数组的 JSON 对象。</value>
|
||||||
|
</data>
|
||||||
<data name="LvPrevProfile" xml:space="preserve">
|
<data name="LvPrevProfile" xml:space="preserve">
|
||||||
<value>前置代理配置别名</value>
|
<value>前置代理配置别名</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -1803,6 +1809,9 @@
|
|||||||
<data name="InvalidHy2RealmUrl" xml:space="preserve">
|
<data name="InvalidHy2RealmUrl" xml:space="preserve">
|
||||||
<value>Realm URL 不正确。</value>
|
<value>Realm URL 不正确。</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="InvalidHttpOutboundHeaders" xml:space="preserve">
|
||||||
|
<value>请填写合法的HTTP请求头JSON。</value>
|
||||||
|
</data>
|
||||||
<data name="TbHy2RealmUrlTip" xml:space="preserve">
|
<data name="TbHy2RealmUrlTip" xml:space="preserve">
|
||||||
<value>格式:realm://<token>@<rendezvous-host>[:port]/<realm-name>?stun=<stun-host>[:port]</value>
|
<value>格式:realm://<token>@<rendezvous-host>[:port]/<realm-name>?stun=<stun-host>[:port]</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -1041,6 +1041,12 @@
|
|||||||
<data name="TbHeaderType8" xml:space="preserve">
|
<data name="TbHeaderType8" xml:space="preserve">
|
||||||
<value>擁塞控制算法</value>
|
<value>擁塞控制算法</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="TbHttpOutboundHeaders" xml:space="preserve">
|
||||||
|
<value>HTTP 請求頭</value>
|
||||||
|
</data>
|
||||||
|
<data name="TipHttpOutboundHeaders" xml:space="preserve">
|
||||||
|
<value>自訂 HTTP 出站請求頭,請輸入值為字串或字串陣列的 JSON 物件。</value>
|
||||||
|
</data>
|
||||||
<data name="LvPrevProfile" xml:space="preserve">
|
<data name="LvPrevProfile" xml:space="preserve">
|
||||||
<value>前置代理節點別名</value>
|
<value>前置代理節點別名</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -1797,4 +1803,7 @@
|
|||||||
<data name="TbLegacyProtectTip" xml:space="preserve">
|
<data name="TbLegacyProtectTip" xml:space="preserve">
|
||||||
<value>啟用則使用 sing-box TUN ,否則使用 xray TUN</value>
|
<value>啟用則使用 sing-box TUN ,否則使用 xray TUN</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="InvalidHttpOutboundHeaders" xml:space="preserve">
|
||||||
|
<value>請填寫合法的HTTP請求頭JSON。</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -96,18 +96,19 @@ public partial class CoreConfigV2rayService
|
|||||||
var balancer = new BalancersItem4Ray
|
var balancer = new BalancersItem4Ray
|
||||||
{
|
{
|
||||||
selector = [selector],
|
selector = [selector],
|
||||||
strategy = strategyType == "leastLoad" ? new()
|
strategy = new()
|
||||||
{
|
{
|
||||||
type = strategyType,
|
type = strategyType,
|
||||||
settings = new()
|
settings = strategyType == "leastLoad"
|
||||||
{
|
? new()
|
||||||
expected = 1,
|
{
|
||||||
tolerance = multipleLoad == EMultipleLoad.Fallback ? 0.2 : null,
|
expected = 1,
|
||||||
maxRTT = multipleLoad == EMultipleLoad.Fallback ? "5000ms" : null,
|
tolerance = multipleLoad == EMultipleLoad.Fallback ? 0.2 : null,
|
||||||
},
|
maxRTT = multipleLoad == EMultipleLoad.Fallback ? "5000ms" : null,
|
||||||
} : null,
|
}
|
||||||
|
: null,
|
||||||
|
},
|
||||||
tag = balancerTag,
|
tag = balancerTag,
|
||||||
fallbackTag = _coreConfig.outbounds?.FirstOrDefault(o => o.tag.StartsWith(selector))?.tag,
|
|
||||||
};
|
};
|
||||||
_coreConfig.routing.balancers ??= [];
|
_coreConfig.routing.balancers ??= [];
|
||||||
_coreConfig.routing.balancers.Add(balancer);
|
_coreConfig.routing.balancers.Add(balancer);
|
||||||
|
|||||||
@@ -136,7 +136,6 @@ public partial class CoreConfigV2rayService
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case EConfigType.SOCKS:
|
case EConfigType.SOCKS:
|
||||||
case EConfigType.HTTP:
|
|
||||||
{
|
{
|
||||||
ServersItem4Ray serversItem;
|
ServersItem4Ray serversItem;
|
||||||
if (outbound.settings.servers.Count <= 0)
|
if (outbound.settings.servers.Count <= 0)
|
||||||
@@ -171,6 +170,31 @@ public partial class CoreConfigV2rayService
|
|||||||
outbound.settings.vnext = null;
|
outbound.settings.vnext = null;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case EConfigType.HTTP:
|
||||||
|
{
|
||||||
|
outbound.settings.address = _node.Address;
|
||||||
|
outbound.settings.port = _node.Port;
|
||||||
|
|
||||||
|
if (protocolExtra.HttpHeaders.IsNotEmpty())
|
||||||
|
{
|
||||||
|
outbound.settings.headers = JsonUtils.ParseJson(protocolExtra.HttpHeaders);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_node.Username.IsNotEmpty()
|
||||||
|
&& _node.Password.IsNotEmpty())
|
||||||
|
{
|
||||||
|
outbound.settings.user = _node.Username;
|
||||||
|
outbound.settings.pass = _node.Password;
|
||||||
|
outbound.settings.level = 1;
|
||||||
|
outbound.settings.email = Global.UserEMail;
|
||||||
|
}
|
||||||
|
|
||||||
|
FillOutboundMux(outbound);
|
||||||
|
|
||||||
|
outbound.settings.vnext = null;
|
||||||
|
outbound.settings.servers = null;
|
||||||
|
break;
|
||||||
|
}
|
||||||
case EConfigType.VLESS:
|
case EConfigType.VLESS:
|
||||||
{
|
{
|
||||||
VnextItem4Ray vnextItem;
|
VnextItem4Ray vnextItem;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
using System.Reflection.Metadata;
|
|
||||||
|
|
||||||
namespace ServiceLib.Services;
|
namespace ServiceLib.Services;
|
||||||
|
|
||||||
|
|||||||
@@ -425,7 +425,7 @@ public class SpeedtestService(Config config, Func<SpeedTestResult, Task> updateF
|
|||||||
ProfileExManager.Instance.SetTestDelay(it.IndexId, responseTime);
|
ProfileExManager.Instance.SetTestDelay(it.IndexId, responseTime);
|
||||||
await UpdateFunc(it.IndexId, responseTime.ToString());
|
await UpdateFunc(it.IndexId, responseTime.ToString());
|
||||||
|
|
||||||
if (responseTime > 0)
|
if (!_config.UiItem.HideColumnIpInfo && responseTime > 0)
|
||||||
{
|
{
|
||||||
var ipInfo = await ConnectionHandler.GetIPInfo(webProxy);
|
var ipInfo = await ConnectionHandler.GetIPInfo(webProxy);
|
||||||
var ipStr = ipInfo?.ToString() ?? Global.None;
|
var ipStr = ipInfo?.ToString() ?? Global.None;
|
||||||
|
|||||||
@@ -80,6 +80,9 @@ public class AddServerViewModel : MyReactiveObject
|
|||||||
[Reactive]
|
[Reactive]
|
||||||
public bool NaiveQuic { get; set; }
|
public bool NaiveQuic { get; set; }
|
||||||
|
|
||||||
|
[Reactive]
|
||||||
|
public string HttpHeadersJson { get; set; }
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public string Hy2RealmUrl { get; set; }
|
public string Hy2RealmUrl { get; set; }
|
||||||
|
|
||||||
@@ -255,7 +258,6 @@ public class AddServerViewModel : MyReactiveObject
|
|||||||
{
|
{
|
||||||
await SaveServerAsync();
|
await SaveServerAsync();
|
||||||
});
|
});
|
||||||
|
|
||||||
this.WhenAnyValue(x => x.Cert)
|
this.WhenAnyValue(x => x.Cert)
|
||||||
.Subscribe(_ => UpdateCertTip());
|
.Subscribe(_ => UpdateCertTip());
|
||||||
|
|
||||||
@@ -311,6 +313,7 @@ public class AddServerViewModel : MyReactiveObject
|
|||||||
CongestionControl = protocolExtra.CongestionControl ?? string.Empty;
|
CongestionControl = protocolExtra.CongestionControl ?? string.Empty;
|
||||||
InsecureConcurrency = protocolExtra.InsecureConcurrency > 0 ? protocolExtra.InsecureConcurrency : null;
|
InsecureConcurrency = protocolExtra.InsecureConcurrency > 0 ? protocolExtra.InsecureConcurrency : null;
|
||||||
NaiveQuic = protocolExtra.NaiveQuic ?? false;
|
NaiveQuic = protocolExtra.NaiveQuic ?? false;
|
||||||
|
HttpHeadersJson = protocolExtra.HttpHeaders ?? string.Empty;
|
||||||
Hy2RealmUrl = protocolExtra.Hy2RealmUrl ?? string.Empty;
|
Hy2RealmUrl = protocolExtra.Hy2RealmUrl ?? string.Empty;
|
||||||
GeckoMinPacketSize = protocolExtra.GeckoMinPacketSize.ToInt();
|
GeckoMinPacketSize = protocolExtra.GeckoMinPacketSize.ToInt();
|
||||||
GeckoMaxPacketSize = protocolExtra.GeckoMaxPacketSize.ToInt();
|
GeckoMaxPacketSize = protocolExtra.GeckoMaxPacketSize.ToInt();
|
||||||
@@ -379,6 +382,11 @@ public class AddServerViewModel : MyReactiveObject
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (HttpHeadersJson.IsNotEmpty() && JsonUtils.ParseJson(HttpHeadersJson) == null)
|
||||||
|
{
|
||||||
|
NoticeManager.Instance.Enqueue(ResUI.InvalidHttpOutboundHeaders);
|
||||||
|
return;
|
||||||
|
}
|
||||||
SelectedSource.CoreType = CoreType.IsNullOrEmpty() ? null : Enum.Parse<ECoreType>(CoreType);
|
SelectedSource.CoreType = CoreType.IsNullOrEmpty() ? null : Enum.Parse<ECoreType>(CoreType);
|
||||||
SelectedSource.AllowInsecure = AllowInsecure ? Global.StringTrue : Global.StringFalse;
|
SelectedSource.AllowInsecure = AllowInsecure ? Global.StringTrue : Global.StringFalse;
|
||||||
SelectedSource.MuxEnabled = MuxEnabled;
|
SelectedSource.MuxEnabled = MuxEnabled;
|
||||||
@@ -416,6 +424,7 @@ public class AddServerViewModel : MyReactiveObject
|
|||||||
VmessSecurity = VmessSecurity.NullIfEmpty(),
|
VmessSecurity = VmessSecurity.NullIfEmpty(),
|
||||||
VlessEncryption = VlessEncryption.NullIfEmpty(),
|
VlessEncryption = VlessEncryption.NullIfEmpty(),
|
||||||
SsMethod = SsMethod.NullIfEmpty(),
|
SsMethod = SsMethod.NullIfEmpty(),
|
||||||
|
HttpHeaders = SelectedSource.ConfigType == EConfigType.HTTP ? HttpHeadersJson.NullIfEmpty() : null,
|
||||||
WgPublicKey = WgPublicKey.NullIfEmpty(),
|
WgPublicKey = WgPublicKey.NullIfEmpty(),
|
||||||
WgPresharedKey = WgPresharedKey.NullIfEmpty(),
|
WgPresharedKey = WgPresharedKey.NullIfEmpty(),
|
||||||
WgInterfaceAddress = WgInterfaceAddress.NullIfEmpty(),
|
WgInterfaceAddress = WgInterfaceAddress.NullIfEmpty(),
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ public class StatusBarViewModel : MyReactiveObject
|
|||||||
_config = AppManager.Instance.Config;
|
_config = AppManager.Instance.Config;
|
||||||
SelectedRouting = new();
|
SelectedRouting = new();
|
||||||
SelectedServer = new();
|
SelectedServer = new();
|
||||||
RunningServerToolTipText = "-";
|
RunningServerToolTipText = GetRunningServerToolTipText("-");
|
||||||
BlSystemProxyPacVisible = Utils.IsWindows();
|
BlSystemProxyPacVisible = Utils.IsWindows();
|
||||||
BlIsNonWindows = Utils.IsNonWindows();
|
BlIsNonWindows = Utils.IsNonWindows();
|
||||||
|
|
||||||
@@ -293,16 +293,21 @@ public class StatusBarViewModel : MyReactiveObject
|
|||||||
var running = await ConfigHandler.GetDefaultServer(_config);
|
var running = await ConfigHandler.GetDefaultServer(_config);
|
||||||
if (running != null)
|
if (running != null)
|
||||||
{
|
{
|
||||||
RunningServerDisplay =
|
RunningServerDisplay = running.GetSummary();
|
||||||
RunningServerToolTipText = running.GetSummary();
|
RunningServerToolTipText = GetRunningServerToolTipText(RunningServerDisplay);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
RunningServerDisplay =
|
RunningServerDisplay = ResUI.CheckServerSettings;
|
||||||
RunningServerToolTipText = ResUI.CheckServerSettings;
|
RunningServerToolTipText = GetRunningServerToolTipText(RunningServerDisplay);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string GetRunningServerToolTipText(string serverInfo)
|
||||||
|
{
|
||||||
|
return Utils.IsLinux() ? Global.AppName : serverInfo;
|
||||||
|
}
|
||||||
|
|
||||||
private async Task RefreshServersMenu()
|
private async Task RefreshServersMenu()
|
||||||
{
|
{
|
||||||
var lstModel = await AppManager.Instance.ProfileModels(_config.SubIndexId, "");
|
var lstModel = await AppManager.Instance.ProfileModels(_config.SubIndexId, "");
|
||||||
|
|||||||
@@ -58,6 +58,9 @@ internal class Program
|
|||||||
.UsePlatformDetect()
|
.UsePlatformDetect()
|
||||||
//.WithInterFont()
|
//.WithInterFont()
|
||||||
.WithFontByDefault()
|
.WithFontByDefault()
|
||||||
|
#if DEBUG
|
||||||
|
.WithDeveloperTools()
|
||||||
|
#endif
|
||||||
.LogToTrace()
|
.LogToTrace()
|
||||||
.UseReactiveUI(_ => { });
|
.UseReactiveUI(_ => { });
|
||||||
|
|
||||||
|
|||||||
@@ -256,6 +256,27 @@
|
|||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Width="400"
|
Width="400"
|
||||||
Margin="{StaticResource Margin4}" />
|
Margin="{StaticResource Margin4}" />
|
||||||
|
|
||||||
|
<TextBlock
|
||||||
|
x:Name="tbHttpHeaders"
|
||||||
|
Grid.Row="3"
|
||||||
|
Grid.Column="0"
|
||||||
|
Margin="{StaticResource Margin4}"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
IsVisible="False"
|
||||||
|
Text="{x:Static resx:ResUI.TbHttpOutboundHeaders}"
|
||||||
|
ToolTip.Tip="{x:Static resx:ResUI.TipHttpOutboundHeaders}" />
|
||||||
|
<views:JsonEditor
|
||||||
|
x:Name="txtHttpHeadersJson"
|
||||||
|
Grid.Row="3"
|
||||||
|
Grid.Column="1"
|
||||||
|
Width="400"
|
||||||
|
MinHeight="100"
|
||||||
|
Margin="{StaticResource Margin4}"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
IsVisible="False"
|
||||||
|
ToolTip.Tip="{x:Static resx:ResUI.TipHttpOutboundHeaders}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid
|
<Grid
|
||||||
x:Name="gridVLESS"
|
x:Name="gridVLESS"
|
||||||
@@ -422,12 +443,12 @@
|
|||||||
x:Name="txtMinGeckoPacketSize"
|
x:Name="txtMinGeckoPacketSize"
|
||||||
Width="90"
|
Width="90"
|
||||||
Margin="{StaticResource Margin4}"
|
Margin="{StaticResource Margin4}"
|
||||||
Watermark="Min" />
|
PlaceholderText="Min" />
|
||||||
<TextBox
|
<TextBox
|
||||||
x:Name="txtMaxGeckoPacketSize"
|
x:Name="txtMaxGeckoPacketSize"
|
||||||
Width="90"
|
Width="90"
|
||||||
Margin="{StaticResource Margin4}"
|
Margin="{StaticResource Margin4}"
|
||||||
Watermark="Max" />
|
PlaceholderText="Max" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="{StaticResource Margin4}"
|
Margin="{StaticResource Margin4}"
|
||||||
@@ -460,7 +481,7 @@
|
|||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Width="400"
|
Width="400"
|
||||||
Margin="{StaticResource Margin4}"
|
Margin="{StaticResource Margin4}"
|
||||||
Watermark="1000-2000,3000,4000" />
|
PlaceholderText="1000-2000,3000,4000" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="2"
|
Grid.Row="2"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
@@ -498,12 +519,12 @@
|
|||||||
x:Name="txtUpMbps7"
|
x:Name="txtUpMbps7"
|
||||||
Width="90"
|
Width="90"
|
||||||
Margin="{StaticResource Margin4}"
|
Margin="{StaticResource Margin4}"
|
||||||
Watermark="Up" />
|
PlaceholderText="Up" />
|
||||||
<TextBox
|
<TextBox
|
||||||
x:Name="txtDownMbps7"
|
x:Name="txtDownMbps7"
|
||||||
Width="90"
|
Width="90"
|
||||||
Margin="{StaticResource Margin4}"
|
Margin="{StaticResource Margin4}"
|
||||||
Watermark="Down" />
|
PlaceholderText="Down" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid
|
<Grid
|
||||||
@@ -612,7 +633,7 @@
|
|||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Width="400"
|
Width="400"
|
||||||
Margin="{StaticResource Margin4}"
|
Margin="{StaticResource Margin4}"
|
||||||
Watermark="0, 0, 0" />
|
PlaceholderText="0, 0, 0" />
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="5"
|
Grid.Row="5"
|
||||||
@@ -626,7 +647,7 @@
|
|||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Width="400"
|
Width="400"
|
||||||
Margin="{StaticResource Margin4}"
|
Margin="{StaticResource Margin4}"
|
||||||
Watermark="Ipv4,Ipv6" />
|
PlaceholderText="Ipv4,Ipv6" />
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="6"
|
Grid.Row="6"
|
||||||
@@ -641,7 +662,7 @@
|
|||||||
Width="200"
|
Width="200"
|
||||||
Margin="{StaticResource Margin4}"
|
Margin="{StaticResource Margin4}"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Watermark="1280" />
|
PlaceholderText="1280" />
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid
|
<Grid
|
||||||
x:Name="gridAnytls"
|
x:Name="gridAnytls"
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using v2rayN.Desktop.Base;
|
using v2rayN.Desktop.Base;
|
||||||
|
using v2rayN.Desktop.Common;
|
||||||
|
|
||||||
namespace v2rayN.Desktop.Views;
|
namespace v2rayN.Desktop.Views;
|
||||||
|
|
||||||
@@ -54,8 +55,13 @@ public partial class AddServerWindow : WindowBase<AddServerViewModel>
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case EConfigType.SOCKS:
|
case EConfigType.SOCKS:
|
||||||
|
gridSocks.IsVisible = true;
|
||||||
|
break;
|
||||||
|
|
||||||
case EConfigType.HTTP:
|
case EConfigType.HTTP:
|
||||||
gridSocks.IsVisible = true;
|
gridSocks.IsVisible = true;
|
||||||
|
tbHttpHeaders.IsVisible = true;
|
||||||
|
txtHttpHeadersJson.IsVisible = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EConfigType.VLESS:
|
case EConfigType.VLESS:
|
||||||
@@ -148,9 +154,14 @@ public partial class AddServerWindow : WindowBase<AddServerViewModel>
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case EConfigType.SOCKS:
|
case EConfigType.SOCKS:
|
||||||
|
this.Bind(ViewModel, vm => vm.SelectedSource.Password, v => v.txtId4.Text).DisposeWith(disposables);
|
||||||
|
this.Bind(ViewModel, vm => vm.SelectedSource.Username, v => v.txtSecurity4.Text).DisposeWith(disposables);
|
||||||
|
break;
|
||||||
|
|
||||||
case EConfigType.HTTP:
|
case EConfigType.HTTP:
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.Password, v => v.txtId4.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.Password, v => v.txtId4.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.Username, v => v.txtSecurity4.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.Username, v => v.txtSecurity4.Text).DisposeWith(disposables);
|
||||||
|
this.Bind(ViewModel, vm => vm.HttpHeadersJson, v => v.txtHttpHeadersJson.Text).DisposeWith(disposables);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EConfigType.VLESS:
|
case EConfigType.VLESS:
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
Width="200"
|
Width="200"
|
||||||
VerticalContentAlignment="Center"
|
VerticalContentAlignment="Center"
|
||||||
Margin="{StaticResource MarginLr8}"
|
Margin="{StaticResource MarginLr8}"
|
||||||
Watermark="{x:Static resx:ResUI.ConnectionsHostFilterTitle}" />
|
PlaceholderText="{x:Static resx:ResUI.ConnectionsHostFilterTitle}" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
x:Name="btnConnectionCloseAll"
|
x:Name="btnConnectionCloseAll"
|
||||||
|
|||||||
@@ -317,7 +317,7 @@
|
|||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
Classes="TextArea"
|
Classes="TextArea"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
Watermark="{x:Static resx:ResUI.TbDNSHostsConfig}" />
|
PlaceholderText="{x:Static resx:ResUI.TbDNSHostsConfig}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
CanResize="False"
|
CanResize="False"
|
||||||
ShowInTaskbar="False"
|
ShowInTaskbar="False"
|
||||||
SizeToContent="Height"
|
SizeToContent="Height"
|
||||||
SystemDecorations="Full"
|
WindowDecorations="Full"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
Width="200"
|
Width="200"
|
||||||
Margin="{StaticResource MarginLr8}"
|
Margin="{StaticResource MarginLr8}"
|
||||||
VerticalContentAlignment="Center"
|
VerticalContentAlignment="Center"
|
||||||
Watermark="{x:Static resx:ResUI.MsgFilterTitle}" />
|
PlaceholderText="{x:Static resx:ResUI.MsgFilterTitle}" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
x:Name="btnCopy"
|
x:Name="btnCopy"
|
||||||
|
|||||||
@@ -279,12 +279,12 @@
|
|||||||
x:Name="txtUpMbps"
|
x:Name="txtUpMbps"
|
||||||
Width="90"
|
Width="90"
|
||||||
Margin="{StaticResource Margin4}"
|
Margin="{StaticResource Margin4}"
|
||||||
Watermark="Up" />
|
PlaceholderText="Up" />
|
||||||
<TextBox
|
<TextBox
|
||||||
x:Name="txtDownMbps"
|
x:Name="txtDownMbps"
|
||||||
Width="90"
|
Width="90"
|
||||||
Margin="{StaticResource Margin4}"
|
Margin="{StaticResource Margin4}"
|
||||||
Watermark="Down" />
|
PlaceholderText="Down" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
@@ -351,7 +351,7 @@
|
|||||||
Width="120"
|
Width="120"
|
||||||
Margin="{StaticResource Margin4}"
|
Margin="{StaticResource Margin4}"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Watermark="50-100" />
|
PlaceholderText="50-100" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
@@ -373,7 +373,7 @@
|
|||||||
Width="120"
|
Width="120"
|
||||||
Margin="{StaticResource Margin4}"
|
Margin="{StaticResource Margin4}"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Watermark="10-20" />
|
PlaceholderText="10-20" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="2"
|
Grid.Row="2"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
@@ -395,7 +395,7 @@
|
|||||||
Width="120"
|
Width="120"
|
||||||
Margin="{StaticResource Margin4}"
|
Margin="{StaticResource Margin4}"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Watermark="0" />
|
PlaceholderText="0" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="3"
|
Grid.Row="3"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
@@ -461,7 +461,7 @@
|
|||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Width="200"
|
Width="200"
|
||||||
Margin="{StaticResource Margin4}"
|
Margin="{StaticResource Margin4}"
|
||||||
Watermark="0.0.0.0" />
|
PlaceholderText="0.0.0.0" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="23"
|
Grid.Row="23"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
@@ -865,7 +865,7 @@
|
|||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
Watermark="proxy_set.sh" />
|
PlaceholderText="proxy_set.sh" />
|
||||||
<Button
|
<Button
|
||||||
x:Name="btnBrowseCustomSystemProxyScriptPath"
|
x:Name="btnBrowseCustomSystemProxyScriptPath"
|
||||||
Margin="{StaticResource Margin4}"
|
Margin="{StaticResource Margin4}"
|
||||||
@@ -910,7 +910,7 @@
|
|||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
Watermark="pac.txt" />
|
PlaceholderText="pac.txt" />
|
||||||
<Button
|
<Button
|
||||||
x:Name="btnBrowseCustomSystemProxyPacPath"
|
x:Name="btnBrowseCustomSystemProxyPacPath"
|
||||||
Margin="{StaticResource Margin4}"
|
Margin="{StaticResource Margin4}"
|
||||||
|
|||||||
@@ -65,7 +65,7 @@
|
|||||||
Margin="8,0"
|
Margin="8,0"
|
||||||
VerticalContentAlignment="Center"
|
VerticalContentAlignment="Center"
|
||||||
Text="{Binding ServerFilter, Mode=TwoWay}"
|
Text="{Binding ServerFilter, Mode=TwoWay}"
|
||||||
Watermark="{x:Static resx:ResUI.MsgServerTitle}" />
|
PlaceholderText="{x:Static resx:ResUI.MsgServerTitle}" />
|
||||||
</WrapPanel>
|
</WrapPanel>
|
||||||
|
|
||||||
<!-- Profiles grid -->
|
<!-- Profiles grid -->
|
||||||
|
|||||||
@@ -63,7 +63,7 @@
|
|||||||
Width="200"
|
Width="200"
|
||||||
Margin="{StaticResource MarginLr4}"
|
Margin="{StaticResource MarginLr4}"
|
||||||
VerticalContentAlignment="Center"
|
VerticalContentAlignment="Center"
|
||||||
Watermark="{x:Static resx:ResUI.MsgServerTitle}" />
|
PlaceholderText="{x:Static resx:ResUI.MsgServerTitle}" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
x:Name="btnAutofitColumnWidth"
|
x:Name="btnAutofitColumnWidth"
|
||||||
|
|||||||
@@ -431,7 +431,7 @@ public partial class ProfilesView : ReactiveUserControl<ProfilesViewModel>
|
|||||||
}
|
}
|
||||||
if (item.Name.Equals("IpInfo", StringComparison.CurrentCultureIgnoreCase))
|
if (item.Name.Equals("IpInfo", StringComparison.CurrentCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
item2.IsVisible = _config.SpeedTestItem.IPAPIUrl.IsNotEmpty();
|
item2.IsVisible = _config.SpeedTestItem.IPAPIUrl.IsNotEmpty() && !_config.UiItem.HideColumnIpInfo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,7 +68,7 @@
|
|||||||
Margin="{StaticResource Margin4}"
|
Margin="{StaticResource Margin4}"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
Watermark="{x:Static resx:ResUI.SubUrlTips}" />
|
PlaceholderText="{x:Static resx:ResUI.SubUrlTips}" />
|
||||||
<Button
|
<Button
|
||||||
Grid.Row="2"
|
Grid.Row="2"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
@@ -99,7 +99,7 @@
|
|||||||
Classes="TextArea"
|
Classes="TextArea"
|
||||||
MinLines="4"
|
MinLines="4"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
Watermark="{x:Static resx:ResUI.SubUrlTips}" />
|
PlaceholderText="{x:Static resx:ResUI.SubUrlTips}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Flyout>
|
</Flyout>
|
||||||
</Button.Flyout>
|
</Button.Flyout>
|
||||||
@@ -128,7 +128,7 @@
|
|||||||
Margin="{StaticResource Margin4}"
|
Margin="{StaticResource Margin4}"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
DockPanel.Dock="Right"
|
DockPanel.Dock="Right"
|
||||||
Watermark="{x:Static resx:ResUI.SubUrlTips}" />
|
PlaceholderText="{x:Static resx:ResUI.SubUrlTips}" />
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="{StaticResource Margin4}"
|
Margin="{StaticResource Margin4}"
|
||||||
@@ -149,7 +149,7 @@
|
|||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Margin="{StaticResource Margin4}"
|
Margin="{StaticResource Margin4}"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Watermark="{x:Static resx:ResUI.SubUrlTips}" />
|
PlaceholderText="{x:Static resx:ResUI.SubUrlTips}" />
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="6"
|
Grid.Row="6"
|
||||||
@@ -178,7 +178,7 @@
|
|||||||
Margin="{StaticResource Margin4}"
|
Margin="{StaticResource Margin4}"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
Watermark="{x:Static resx:ResUI.SubUrlTips}" />
|
PlaceholderText="{x:Static resx:ResUI.SubUrlTips}" />
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="8"
|
Grid.Row="8"
|
||||||
@@ -206,7 +206,7 @@
|
|||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Margin="{StaticResource Margin4}"
|
Margin="{StaticResource Margin4}"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Watermark="{x:Static resx:ResUI.LvPrevProfileTip}" />
|
PlaceholderText="{x:Static resx:ResUI.LvPrevProfileTip}" />
|
||||||
<Button
|
<Button
|
||||||
Grid.Row="9"
|
Grid.Row="9"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
@@ -226,7 +226,7 @@
|
|||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Margin="{StaticResource Margin4}"
|
Margin="{StaticResource Margin4}"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Watermark="{x:Static resx:ResUI.LvPrevProfileTip}" />
|
PlaceholderText="{x:Static resx:ResUI.LvPrevProfileTip}" />
|
||||||
<Button
|
<Button
|
||||||
Grid.Row="10"
|
Grid.Row="10"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
@@ -248,7 +248,7 @@
|
|||||||
Margin="{StaticResource Margin4}"
|
Margin="{StaticResource Margin4}"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
ToolTip.Tip="{x:Static resx:ResUI.TipPreSocksPort}"
|
ToolTip.Tip="{x:Static resx:ResUI.TipPreSocksPort}"
|
||||||
Watermark="{x:Static resx:ResUI.TipPreSocksPort}" />
|
PlaceholderText="{x:Static resx:ResUI.TipPreSocksPort}" />
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="12"
|
Grid.Row="12"
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
<TreatAsUsed>true</TreatAsUsed>
|
<TreatAsUsed>true</TreatAsUsed>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Avalonia.Desktop" />
|
<PackageReference Include="Avalonia.Desktop" />
|
||||||
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" />
|
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="AvaloniaUI.DiagnosticsSupport" />
|
||||||
<PackageReference Include="DialogHost.Avalonia" />
|
<PackageReference Include="DialogHost.Avalonia" />
|
||||||
<PackageReference Include="ReactiveUI.Avalonia" />
|
<PackageReference Include="ReactiveUI.Avalonia" />
|
||||||
<PackageReference Include="Semi.Avalonia" />
|
<PackageReference Include="Semi.Avalonia" />
|
||||||
|
|||||||
@@ -349,6 +349,31 @@
|
|||||||
Width="400"
|
Width="400"
|
||||||
Margin="{StaticResource Margin4}"
|
Margin="{StaticResource Margin4}"
|
||||||
Style="{StaticResource DefTextBox}" />
|
Style="{StaticResource DefTextBox}" />
|
||||||
|
|
||||||
|
<TextBlock
|
||||||
|
x:Name="tbHttpHeaders"
|
||||||
|
Grid.Row="3"
|
||||||
|
Grid.Column="0"
|
||||||
|
Margin="{StaticResource Margin4}"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
Style="{StaticResource ToolbarTextBlock}"
|
||||||
|
Text="{x:Static resx:ResUI.TbHttpOutboundHeaders}"
|
||||||
|
Visibility="Collapsed" />
|
||||||
|
<TextBox
|
||||||
|
x:Name="txtHttpHeadersJson"
|
||||||
|
Grid.Row="3"
|
||||||
|
Grid.Column="1"
|
||||||
|
Width="400"
|
||||||
|
Margin="{StaticResource Margin4}"
|
||||||
|
materialDesign:HintAssist.Hint="{x:Static resx:ResUI.TipHttpOutboundHeaders}"
|
||||||
|
AcceptsReturn="True"
|
||||||
|
HorizontalScrollBarVisibility="Auto"
|
||||||
|
MaxLines="8"
|
||||||
|
MinLines="4"
|
||||||
|
Style="{StaticResource MyOutlinedTextBox}"
|
||||||
|
TextWrapping="NoWrap"
|
||||||
|
VerticalScrollBarVisibility="Auto"
|
||||||
|
Visibility="Collapsed" />
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid
|
<Grid
|
||||||
x:Name="gridVLESS"
|
x:Name="gridVLESS"
|
||||||
|
|||||||
@@ -53,8 +53,13 @@ public partial class AddServerWindow
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case EConfigType.SOCKS:
|
case EConfigType.SOCKS:
|
||||||
|
gridSocks.Visibility = Visibility.Visible;
|
||||||
|
break;
|
||||||
|
|
||||||
case EConfigType.HTTP:
|
case EConfigType.HTTP:
|
||||||
gridSocks.Visibility = Visibility.Visible;
|
gridSocks.Visibility = Visibility.Visible;
|
||||||
|
tbHttpHeaders.Visibility = Visibility.Visible;
|
||||||
|
txtHttpHeadersJson.Visibility = Visibility.Visible;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EConfigType.VLESS:
|
case EConfigType.VLESS:
|
||||||
@@ -147,9 +152,14 @@ public partial class AddServerWindow
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case EConfigType.SOCKS:
|
case EConfigType.SOCKS:
|
||||||
|
this.Bind(ViewModel, vm => vm.SelectedSource.Password, v => v.txtId4.Text).DisposeWith(disposables);
|
||||||
|
this.Bind(ViewModel, vm => vm.SelectedSource.Username, v => v.txtSecurity4.Text).DisposeWith(disposables);
|
||||||
|
break;
|
||||||
|
|
||||||
case EConfigType.HTTP:
|
case EConfigType.HTTP:
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.Password, v => v.txtId4.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.Password, v => v.txtId4.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.Username, v => v.txtSecurity4.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.Username, v => v.txtSecurity4.Text).DisposeWith(disposables);
|
||||||
|
this.Bind(ViewModel, vm => vm.HttpHeadersJson, v => v.txtHttpHeadersJson.Text).DisposeWith(disposables);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EConfigType.VLESS:
|
case EConfigType.VLESS:
|
||||||
|
|||||||
@@ -384,7 +384,7 @@ public partial class ProfilesView
|
|||||||
}
|
}
|
||||||
if (item.Name.Equals("IpInfo", StringComparison.CurrentCultureIgnoreCase))
|
if (item.Name.Equals("IpInfo", StringComparison.CurrentCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
item2.Visibility = _config.SpeedTestItem.IPAPIUrl.IsNotEmpty() ? Visibility.Visible : Visibility.Hidden;
|
item2.Visibility = _config.SpeedTestItem.IPAPIUrl.IsNotEmpty() && !_config.UiItem.HideColumnIpInfo ? Visibility.Visible : Visibility.Hidden;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user