Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
tqk2811 committed Dec 22, 2023
2 parents a20a048 + 84eec5a commit 510cc33
Show file tree
Hide file tree
Showing 106 changed files with 147 additions and 63 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions .github/workflows/Net6-Ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
configuration: [Release]

env:
Solution_Name: TqkLibrary.Proxy.sln # Replace with your solution name, i.e. MyWpfApp.sln.
Test_Project_Path: TestProxy\TestProxy.csproj # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj.
Solution_Name: src\TqkLibrary.Proxy.sln # Replace with your solution name, i.e. MyWpfApp.sln.
Test_Project_Path: src\TestProxy\TestProxy.csproj # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj.


steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/Net6-Window.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ jobs:
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on

env:
Solution_Name: TqkLibrary.Proxy.sln # Replace with your solution name, i.e. MyWpfApp.sln.
Test_Project_Path: TestProxy\TestProxy.csproj # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj.
Solution_Name: src\TqkLibrary.Proxy.sln # Replace with your solution name, i.e. MyWpfApp.sln.
Test_Project_Path: src\TestProxy\TestProxy.csproj # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj.
# Wap_Project_Directory: your-wap-project-directory-name # Replace with the Wap project directory relative to the solution, i.e. MyWpfApp.Package.
# Wap_Project_Path: your-wap-project-path # Replace with the path to your Wap project, i.e. MyWpf.App.Package\MyWpfApp.Package.wapproj.

Expand Down
53 changes: 0 additions & 53 deletions ConsoleTest/ProxyWraper.cs

This file was deleted.

1 change: 0 additions & 1 deletion CsharpNugetPush
Submodule CsharpNugetPush deleted from 6ed641
File renamed without changes.
File renamed without changes.
File renamed without changes.
53 changes: 53 additions & 0 deletions src/ConsoleTest/ProxyWraper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
using TqkLibrary.Proxy.Authentications;
using TqkLibrary.Proxy.Interfaces;
using TqkLibrary.Proxy.ProxyServers;
using TqkLibrary.Proxy.ProxySources;

namespace ConsoleTest
{
internal static class ProxyWraper
{
const string listen = "0.0.0.0:16615";
public static async Task RunAsync()
{
//string strHostName = Dns.GetHostName();
//IPHostEntry iPHostEntry = Dns.GetHostEntry(strHostName);
//IPAddress? ipaddress = null;

//ipaddress = iPHostEntry
// .AddressList
// .FirstOrDefault(ip => ip.AddressFamily == AddressFamily.InterNetwork);

IPEndPoint ipEndPoint = IPEndPoint.Parse(listen);
//if (ipaddress is not null)
//{
// ipEndPoint = new IPEndPoint(ipaddress, 0);
//}

//ipEndPoint = new IPEndPoint(IPAddress.Any, 0);

using var server = new HttpProxyServer(ipEndPoint, GetProxySource());
server.StartListen();
Console.WriteLine($"Listening {server.IPEndPoint}");
Console.ReadLine();
}

static IProxySource GetProxySource()
{
//HttpProxyAuthentication? auth = null;// new HttpProxyAuthentication("", "");
//HttpProxySource httpProxySource = new HttpProxySource(new Uri("http://88.99.245.58:8903"));
//Socks4ProxySource socks4ProxySource = new Socks4ProxySource(IPEndPoint.Parse("93.104.63.65:80"));
//Socks5ProxySource socks5ProxySource = new Socks5ProxySource(IPEndPoint.Parse("138.201.120.118:29127"));
LocalProxySource localProxySource = new LocalProxySource();

return localProxySource;
}
}
}
File renamed without changes.
84 changes: 84 additions & 0 deletions src/CsharpNugetPush/CsharpNugetPush.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
param (
[string]$buildIndex="00"
)
$workingDir = Get-Location
$dirInfo= New-Object -Typename System.IO.DirectoryInfo -ArgumentList ($workingDir)
$projectName= $dirInfo.Name;
$key=$env:nugetKey
$buildDay=[DateTime]::Now.ToString("yyyyMMdd")
$p="buildDay=$($buildDay);buildIndex=$($buildIndex)".Trim()
$build="Release"

function RunCommand
{
$numOfArgs = $args.Length
for ($i=0; $i -lt $numOfArgs; $i++)
{
iex $args[$i]
if($LASTEXITCODE -eq 0 -or $i -eq 0) {
Write-Host "$($args[$i]) success"
}
else{
Write-Host "$($args[$i]) failed"
return 0
}
}
return 1
}

function NugetPack
{
$numOfArgs = $args.Length
for ($i=0; $i -lt $numOfArgs; $i++)
{
Write-Host "NugetPack $($args[$i])"

$result = RunCommand "Remove-Item -Recurse -Force .\bin\$($build)\**" `
"dotnet build .\$($args[$i]).csproj -c $($build)" `
"nuget pack .\$($args[$i]).nuspec -Symbols -OutputDirectory .\bin\$($build) -p 'id=$($args[$i]);$($p)'"

if($result) {
Write-Host "$($args[$i]) success"
}
else{
Write-Host "$($args[$i]) failed"
return 0
}
}
return 1
}

function NugetPush
{
$numOfArgs = $args.Length
for ($i=0; $i -lt $numOfArgs; $i++)
{
Write-Host "NugetPush $($args[$i])"

$files = [System.IO.Directory]::GetFiles(".\bin\$($build)\")
iex "nuget push $($files[0]) -ApiKey $($key) -Source https://api.nuget.org/v3/index.json"
}
}

$result = NugetPack $projectName
if($result)
{
if([string]::IsNullOrEmpty($key))
{
Write-Host "Build & pack success"
}
else
{
Write-Host "enter to push nuget"
pause
Write-Host "enter to confirm"
pause

NugetPush $projectName
}
}
else
{
echo "Build & pack error"
}
pause
1 change: 1 addition & 0 deletions src/CsharpNugetPush/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# CsharpNugetPush
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,24 @@ public StreamTransferHelper(Stream first, Stream second)
_second = second ?? throw new ArgumentNullException(nameof(second));
}

string _firstName = string.Empty;
string _secondName = string.Empty;
string _firstName = "first";
string _secondName = "second";
public StreamTransferHelper DebugName(object? first, object? second)
{
return DebugName(first?.ToString(), second?.ToString());
}
public StreamTransferHelper DebugName(string? firstName, string? secondName)
{
this._firstName = firstName ?? string.Empty;
this._secondName = secondName ?? string.Empty;
this._firstName = firstName ?? "first";
this._secondName = secondName ?? "second";
return this;
}

public Task WaitUntilDisconnect(CancellationToken cancellationToken = default)
{
Task task_first = FirstToSecond(cancellationToken);
Task task_second = SecondToFirst(cancellationToken);
return Task.WhenAny(task_first, task_second);
return Task.WhenAll(task_first, task_second);
}

async Task FirstToSecond(CancellationToken cancellationToken = default)
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 510cc33

Please sign in to comment.