Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
trudyhood committed Feb 3, 2023
2 parents 3b8bf42 + 12e3350 commit b067763
Show file tree
Hide file tree
Showing 69 changed files with 988 additions and 278 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# v2.6.346
### Client
* Update: Improve stability when using no UDP mode

### Server
* Feature: Improve stability by adding lifetime to TcpDatagarmChannel
* Fix: IpV6 detection

# v2.6.342
### Client
* Fix: UDP port memory leak
Expand Down
2 changes: 1 addition & 1 deletion Pub/PublishToGitHub.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ $changeLog | Out-File -FilePath "$solutionDir/CHANGELOG.md" -Encoding utf8 -For

# create release note
$releaseNote = $text -replace "# Upcoming", "$versionTag`n";
$releaseNote = $releaseNote -replace "# $versionTag", "$versionTag"; # remove version hash
$releaseNote = $releaseNote -replace "# $versionTag`n", ""; # remove version hash
$releaseNote = $releaseNote.SubString(0, $releaseNote.IndexOf("`n# "));
# $releaseNote += "To see a list of all changes visit: [Changelog](https://github.com/vpnhood/VpnHood/blob/main/CHANGELOG.md)";
$releaseNote | Out-File -FilePath "$packagesRootDir/ReleaseNote.txt" -Encoding utf8 -Force -NoNewline;
Expand Down
4 changes: 2 additions & 2 deletions Pub/Version.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"Major": 2,
"Minor": 6,
"Build": 344,
"BumpTime": "2023-01-28T00:07:43.7571315Z",
"Build": 346,
"BumpTime": "2023-02-03T21:51:41.0629987Z",
"Prerelease": false,
"DeprecatedVersion": "2.0.0"
}
2 changes: 1 addition & 1 deletion VpnHood.Client.App.Android/Properties/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="344" package="com.vpnhood.client.android" android:installLocation="auto" android:versionName="2.6.344">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="346" package="com.vpnhood.client.android" android:installLocation="auto" android:versionName="2.6.346">
<uses-sdk android:minSdkVersion="22" android:targetSdkVersion="33" />
<uses-feature android:name="android.software.leanback" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
Expand Down
4 changes: 2 additions & 2 deletions VpnHood.Client.App.UI/VpnHood.Client.App.UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<PackageIcon>VpnHood.png</PackageIcon>
<Description>Tiny internal webserver to server your single-page application (SPA). You need this only if you want to create a UI for your VpnHood client by single-page application (SPA).</Description>
<PackageId>VpnHood.Client.App.UI</PackageId>
<Version>2.6.344</Version>
<AssemblyVersion>2.6.344</AssemblyVersion>
<Version>2.6.346</Version>
<AssemblyVersion>2.6.346</AssemblyVersion>
<FileVersion>$([System.DateTime]::Now.ToString("yyyy.M.d.HHmm"))</FileVersion>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
Expand Down
2 changes: 1 addition & 1 deletion VpnHood.Client.App.UI/VpnHoodAppUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public static VpnHoodAppUi Init(Stream zipStream, int defaultPort = 9090)

private void Start()
{
_url = $"http://{Util.GetFreeEndPoint(IPAddress.Loopback, DefaultPort)}";
_url = $"http://{Util.GetFreeTcpEndPoint(IPAddress.Loopback, DefaultPort)}";
_server = CreateWebServer(Url, GetSpaPath());
try
{
Expand Down
2 changes: 1 addition & 1 deletion VpnHood.Client.App.Win/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"VpnHood.Client.App.Net": {
"commandName": "Executable",
"executablePath": "dotnet",
"commandLineArgs": "VpnHoodClient.dll"
"commandLineArgs": "VpnHoodClient.dll server"
}
}
}
4 changes: 2 additions & 2 deletions VpnHood.Client.App.Win/VpnHood.Client.App.Win.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
<PackageIcon>VpnHood.png</PackageIcon>
<PackageId>VpnHood.Client.App.Win</PackageId>
<StartupObject></StartupObject>
<Version>2.6.344</Version>
<AssemblyVersion>2.6.344</AssemblyVersion>
<Version>2.6.346</Version>
<AssemblyVersion>2.6.346</AssemblyVersion>
<FileVersion>$([System.DateTime]::Now.ToString("yyyy.M.d.HHmm"))</FileVersion>
<Nullable>enable</Nullable>
<LangVersion>11</LangVersion>
Expand Down
4 changes: 2 additions & 2 deletions VpnHood.Client.App/VpnHood.Client.App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<RepositoryUrl>https://github.com/vpnhood/vpnhood</RepositoryUrl>
<Description>Readymade Vpn App skeleton for VpnHood clients. You just need to create a UI on it.</Description>
<PackageId>VpnHood.Client.App</PackageId>
<Version>2.6.344</Version>
<AssemblyVersion>2.6.344</AssemblyVersion>
<Version>2.6.346</Version>
<AssemblyVersion>2.6.346</AssemblyVersion>
<FileVersion>$([System.DateTime]::Now.ToString("yyyy.M.d.HHmm"))</FileVersion>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
Expand Down
2 changes: 1 addition & 1 deletion VpnHood.Client.App/VpnHoodApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ public async Task Connect(Guid clientProfileId, bool diagnose = false, string? u
if (eventId == GeneralEventId.Nat) return VhLogger.IsDiagnoseMode;
if (eventId == GeneralEventId.Dns) return VhLogger.IsDiagnoseMode;
if (eventId == GeneralEventId.Udp) return VhLogger.IsDiagnoseMode;
if (eventId == GeneralEventId.StreamChannel) return VhLogger.IsDiagnoseMode;
if (eventId == GeneralEventId.TcpProxyChannel) return VhLogger.IsDiagnoseMode;
if (eventId == GeneralEventId.DatagramChannel) return true;
return true;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
<RepositoryUrl>https://github.com/vpnhood/vpnhood</RepositoryUrl>
<PackageIcon>VpnHood.png</PackageIcon>
<Description>VpnHood client device provider for Windows using WinDivert.</Description>
<Version>2.6.344</Version>
<Version>2.6.346</Version>
<PackageId>VpnHood.Client.Device.WinDivert</PackageId>
<Version>1.1.226</Version>
<AssemblyVersion>2.6.344</AssemblyVersion>
<AssemblyVersion>2.6.346</AssemblyVersion>
<FileVersion>$([System.DateTime]::Now.ToString("yyyy.M.d.HHmm"))</FileVersion>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
Expand Down
4 changes: 2 additions & 2 deletions VpnHood.Client.Device/VpnHood.Client.Device.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<RepositoryType></RepositoryType>
<PackageId>VpnHood.Client.Device</PackageId>
<RootNamespace>VpnHood.Client.Device</RootNamespace>
<Version>2.6.344</Version>
<AssemblyVersion>2.6.344</AssemblyVersion>
<Version>2.6.346</Version>
<AssemblyVersion>2.6.346</AssemblyVersion>
<FileVersion>$([System.DateTime]::Now.ToString("yyyy.M.d.HHmm"))</FileVersion>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
Expand Down
6 changes: 4 additions & 2 deletions VpnHood.Client/ClientOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ public class ClientOptions
public SocketFactory SocketFactory { get; set; } = new();
public int MaxDatagramChannelCount { get; set; } = 4;
public string UserAgent { get; set; } = Environment.OSVersion.ToString();

#if DEBUG
public TimeSpan MinTcpDatagramTimespan { get; set; } = TimeSpan.FromMinutes(5);
public TimeSpan MaxTcpDatagramTimespan { get; set; } = TimeSpan.FromMinutes(10);

#if DEBUG
public int ProtocolVersion { get; set; }
#endif
}
8 changes: 4 additions & 4 deletions VpnHood.Client/TcpProxyHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ private async Task ProcessClient(TcpClient orgTcpClient, CancellationToken cance
// create a scope for the logger
using var scope = VhLogger.Instance.BeginScope(
$"LocalPort: {natItem.SourcePort}, RemoteEp: {VhLogger.Format(natItem.DestinationAddress)}:{natItem.DestinationPort}");
VhLogger.Instance.LogTrace(GeneralEventId.StreamChannel, "New TcpProxy Request.");
VhLogger.Instance.LogTrace(GeneralEventId.TcpProxyChannel, "New TcpProxy Request.");

// check invalid income
var loopbackAddress = ipVersion == IPVersion.IPv4 ? LoopbackAddressIpV4 : LoopbackAddressIpV6;
Expand All @@ -249,7 +249,7 @@ await Client.AddPassthruTcpStream(
Util.GenerateSessionKey(),
natItem.DestinationPort == 443 ? TunnelUtil.TlsHandshakeLength : -1);

tcpProxyClientStream = await Client.GetTlsConnectionToServer(GeneralEventId.StreamChannel, cancellationToken);
tcpProxyClientStream = await Client.GetTlsConnectionToServer(GeneralEventId.TcpProxyChannel, cancellationToken);
tcpProxyClientStream.TcpClient.ReceiveBufferSize = orgTcpClient.ReceiveBufferSize;
tcpProxyClientStream.TcpClient.SendBufferSize = orgTcpClient.SendBufferSize;
tcpProxyClientStream.TcpClient.SendTimeout = orgTcpClient.SendTimeout;
Expand All @@ -260,7 +260,7 @@ await Client.SendRequest<SessionResponseBase>(tcpProxyClientStream.Stream,
RequestCode.TcpProxyChannel, request, cancellationToken);

// create a TcpProxyChannel
VhLogger.Instance.LogTrace(GeneralEventId.StreamChannel,
VhLogger.Instance.LogTrace(GeneralEventId.TcpProxyChannel,
$"Adding a channel to session {VhLogger.FormatId(request.SessionId)}...");
var orgTcpClientStream = new TcpClientStream(orgTcpClient, orgTcpClient.GetStream());

Expand All @@ -277,7 +277,7 @@ await Client.SendRequest<SessionResponseBase>(tcpProxyClientStream.Stream,
{
tcpProxyClientStream?.Dispose();
orgTcpClient.Dispose();
VhLogger.Instance.LogError(GeneralEventId.StreamChannel, $"{ex.Message}");
VhLogger.Instance.LogError(GeneralEventId.TcpProxyChannel, $"{ex.Message}");
}
}
}
4 changes: 2 additions & 2 deletions VpnHood.Client/VpnHood.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<Copyright>2022 VpnHood</Copyright>
<PackageId>VpnHood.Client</PackageId>
<PackageTags>VPN VpnClient Proxy</PackageTags>
<Version>2.6.344</Version>
<AssemblyVersion>2.6.344</AssemblyVersion>
<Version>2.6.346</Version>
<AssemblyVersion>2.6.346</AssemblyVersion>
<FileVersion>$([System.DateTime]::Now.ToString("yyyy.M.d.HHmm"))</FileVersion>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
Expand Down
Loading

0 comments on commit b067763

Please sign in to comment.