简体   繁体   中英

Unable to connect to the remote server but works when fiddler is running metro app

I have a strange issue, I am trying to retrieve a XML string from a network computer and it works when I am outside of my own network but when I am on the same network I get exceptions such as:

+       $exception  {"Unable to connect to the remote server"}  System.Exception {System.Net.WebException}

An attempt was made to access a socket in a way forbidden by its access permissions 192.168.2.214:8080

the code I am using is:

Uri URL = new Uri(SabURL + QueueStatusURL + API);
            string myURL = URL.AbsolutePath;



            var xmlResults = XDocument.Load(URL.OriginalString.ToString());

The strange part is that when I run Fiddler4 it works just fine, what does Fiddler do that makes it start working? Is this some sort of proxy issue and if so how would I handle it?

Try adding the capability of Private Networks, it worked for me

在此输入图像描述

This is a behavior issue in IE. if a request doesnt resolve, it will not show the response and not navigate to the page. Chrome on the other hand doesnt care if a request doesnt resolve but shows the URL nonetheless with a message that server not found or similar.

What fiddler does is act as a proxy when it is turned on. So wwhen you have fiddler running, it tries to resolve a request and then passes an html page to IE even if there was an error. so IE always shows something when fiddler is running since IE doesnt try to handle requests itself.

There is no known way of changing this behavior unfortunately.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM