-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
305 additions
and
746 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace TestProxy | ||
{ | ||
public abstract class BaseBindTest : BaseConnectTest | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using Newtonsoft.Json; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using TqkLibrary.Proxy.Interfaces; | ||
using TqkLibrary.Proxy.ProxyServers; | ||
|
||
namespace TestProxy | ||
{ | ||
public abstract class BaseClassTest : IDisposable | ||
{ | ||
protected readonly HttpClient _httpClient; | ||
readonly BaseProxyServer _proxyServer; | ||
|
||
protected BaseClassTest() | ||
{ | ||
_proxyServer = CreateServer(GetProxySource()); | ||
_proxyServer.StartListen(); | ||
_httpClient = new HttpClient(CreateHttpMessageHandler(_proxyServer), true); | ||
} | ||
~BaseClassTest() | ||
{ | ||
Dispose(false); | ||
} | ||
public void Dispose() | ||
{ | ||
Dispose(true); | ||
GC.SuppressFinalize(this); | ||
} | ||
protected virtual void Dispose(bool isDisposing) | ||
{ | ||
_httpClient.Dispose(); | ||
_proxyServer.Dispose(); | ||
} | ||
protected abstract IProxySource GetProxySource(); | ||
protected abstract BaseProxyServer CreateServer(IProxySource proxySource); | ||
protected abstract HttpMessageHandler CreateHttpMessageHandler(BaseProxyServer baseProxyServer); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace TestProxy | ||
{ | ||
public abstract class BaseUdpTest : BaseBindTest | ||
{ | ||
|
||
} | ||
} |
146 changes: 0 additions & 146 deletions
146
src/TestProxy/HttpProxyServerTest/HttpProxySourceIpV6Test.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.