Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 774
nGX Avatar asked Dec 21 '22 16:12

nGX


2 Answers

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

enter image description here

like image 130
Haris Hasan Avatar answered May 01 '23 10:05

Haris Hasan


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.

like image 21
randomThought Avatar answered May 01 '23 12:05

randomThought