titanium-web-proxy icon indicating copy to clipboard operation
titanium-web-proxy copied to clipboard

way to use any other gateway without using default gateway in the computer

Open asinthe1 opened this issue 5 years ago • 6 comments

Is there any option to use another gateway for the proxy server without using the default gateway in windows

thanks

asinthe1 avatar Jun 21 '20 14:06 asinthe1

Yes, you can set any upstream proxy... you don't have to use the windows proxy settings. Moreover you can use different upsteream proxy for each request (for example by url or for load balancing reason)

honfika avatar Jun 21 '20 14:06 honfika

thanks for the quick reply can you please direct me to sample code

thanks and best regards

asinthe1 avatar Jun 21 '20 14:06 asinthe1

You can find the sample code here: https://github.com/justcoding121/Titanium-Web-Proxy/blob/master/examples/Titanium.Web.Proxy.Examples.Basic/ProxyTestController.cs

Check the following properties: UpStreamHttpProxy, UpStreamHttpsProxy, GetCustomUpStreamProxyFunc

honfika avatar Jun 21 '20 14:06 honfika

Thanks for your reply i try like this var proxyServer = new ProxyServer(); proxyServer.UpStreamHttpProxy = new ExternalProxy("192.168.1.2", 808); proxyServer.UpStreamHttpsProxy = new ExternalProxy("192.168.1.2", 808);

its works fine for all traffic but if i want external proxy for specific sites for eg: facebook.com how to implement that i try OnRequest method like this if (e.HttpClient.Request.RequestUri.AbsoluteUri.Contains("facebook.com")) { e.CustomUpStreamProxy = new ExternalProxy("192.168.1.12", 808); }

then its not working is there any option to do that

and is there any option to use a gateway instead of proxy

thank you very much and best regards

asinthe1 avatar Jun 21 '20 16:06 asinthe1

Is your code at least called?

honfika avatar Jun 21 '20 16:06 honfika

yes its called i try in debug mode and object e.CustomUpStreamProxy has new value as well

asinthe1 avatar Jun 22 '20 06:06 asinthe1