This commit is contained in:
@@ -33,7 +33,8 @@ namespace SuccessfulCodeTools.LowLevelHttpClient
|
|||||||
var ipLocalEndPoint = new IPEndPoint(IPAddress.Any, outBoundPort);
|
var ipLocalEndPoint = new IPEndPoint(IPAddress.Any, outBoundPort);
|
||||||
using (var tcp = new TcpClient(ipLocalEndPoint))
|
using (var tcp = new TcpClient(ipLocalEndPoint))
|
||||||
{
|
{
|
||||||
var remoteEndpoint = new IPEndPoint(Dns.GetHostEntry(message.Uri.Host).AddressList[0], 80);
|
var remoteIp = message.IpToOveride ?? Dns.GetHostEntry(message.Uri.Host).AddressList[0];
|
||||||
|
var remoteEndpoint = new IPEndPoint(remoteIp, 80);
|
||||||
|
|
||||||
tcp.Connect(remoteEndpoint);
|
tcp.Connect(remoteEndpoint);
|
||||||
tcp.LingerState.Enabled = false;
|
tcp.LingerState.Enabled = false;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Specialized;
|
using System.Collections.Specialized;
|
||||||
|
using System.Net;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
@@ -13,6 +14,7 @@ namespace SuccessfulCodeTools.LowLevelHttpClient
|
|||||||
public Uri Uri { get; set; }
|
public Uri Uri { get; set; }
|
||||||
public string Method { get; set; }
|
public string Method { get; set; }
|
||||||
|
|
||||||
|
public IPAddress IpToOveride { get; set; }
|
||||||
public CustomHttpRequestMessage(HttpMethod method, string url)
|
public CustomHttpRequestMessage(HttpMethod method, string url)
|
||||||
{
|
{
|
||||||
Uri = new Uri(url);
|
Uri = new Uri(url);
|
||||||
|
|||||||
Reference in New Issue
Block a user