English 中文(简体)
为什么为我赢得了网上Proxy BypassProxyOn当地工作?
原标题:why won t WebProxy BypassProxyOnLocal work for me?

我试图从C# .NET到当地地址(当地人:3,000)来获取吉卜赛人协会电话,以便使用代理I组(我可以通过假借)。 如果我把“URL”的目标放在一个非当地地址上,则采用以下的“网络服务”办法,但我需要将其指向当地的一个网络服务器I(当地东道方:3000),而如果我这样做,则请求不是通过代理人。

我引述了“孔氧标.BypassProxyOn Local = 虚假”。 这应当使它无法发挥作用。 任何建议都是如何迫使请求通过网站发布,以了解当地地址。

    WebProxy proxyObject = new WebProxy("http://localhost:8888/", false);
    proxyObject.Credentials = new NetworkCredential(); 
    proxyObject.BypassProxyOnLocal = false;
    WebRequest.DefaultWebProxy = proxyObject;

    var request = (HttpWebRequest)WebRequest.Create(targetUri);

    // I also included this line as a double check
    request.Proxy = proxyObject;

然而,后来的电话并不通过代理人,例如当我这样做时:

 var res = (HttpWebResponse)req.GetResponse();

感谢

问题回答

我仅通过向当地东道方投送一个“ot”,而不是进入“当地东道方”,来绕过“当地东道方”。 (在东道国名末尾注明)

Credit where credit is due: I got this unusual tip from this thread http://www.west-wind.com/weblog/posts/2009/Jan/14/Monitoring-HTTP-Output-with-Fiddler-in-NET-HTTP-Clients-and-WCF-Proxies#596591

页: 1

https://docs.telerik.com/fiddler/observe-traffic/troublefireing/notrafficto localhost

因特网探索者与 该网络框架难以编码,不能通过任何代理人发出当地东道方的请求,作为代理人,菲德尔不会收到这种交通。

最简单的工作是把你的机器名称作为东道国,而不是地方托管或127.0.0.1。 因此,例如,不要打上http:// localhost:8081/mytestpage.aspx, 而是访问。 http://Actionnename:8081/mytestpage.aspx。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签