Commit d21ea354 authored by Honfika's avatar Honfika

add UpStreamEndPoint to sample

parent 3d746940
......@@ -207,6 +207,12 @@ namespace Titanium.Web.Proxy.Examples.Basic
{
e.GetState().PipelineInfo.AppendLine(nameof(onRequest) + ":" + e.HttpClient.Request.RequestUri);
var clientLocalIp = e.ClientLocalEndPoint.Address;
if (!clientLocalIp.Equals(IPAddress.Loopback) && !clientLocalIp.Equals(IPAddress.IPv6Loopback))
{
e.HttpClient.UpStreamEndPoint = new IPEndPoint(clientLocalIp, 0);
}
if (e.HttpClient.Request.Url.Contains("yahoo.com"))
{
e.CustomUpStreamProxy = new ExternalProxy("localhost", 8888);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment