WebApi client not using default proxy settings
RobP
Posted on
Nov 20 2014
I've been having issues with a .Net WebApi project I have, using the Raygun4Net.WebApi library, where the RaygunWebApiClient was not able to connect to the api.raygun.io endpoint. The server in question that is running this application has to go through a proxy (no credentials required), configured as standard in the IE settings, but for some reason the RaygunWebApiClient is not using the proxy and trying to connect directly (which is being refused).
I created a console application to test as well on this server, and that worked with no issues - using the proxy as expected.
I managed to solve the problem by adding the proxy details in the web.config file:
I had to add the address as well - just adding the proxy node with the "usesystemdefault" attribute wasn't enough.
I'm not sure if this is an issue with WebApi or with Raygun but I thought I'd put it up here in case others encounter the same issue.
Jamie Penney
Posted on
Nov 28 2014
I think you might be right about this being specific to WebApi projects. We're using the same code in both the regular Raygun4Net package and the WebApi package to send errors:
https://github.com/MindscapeHQ/raygun4net/blob/master/Mindscape.Raygun4Net/RaygunClient.cs#L335
So I'm not sure what else we would have to change to get it to work out of the box. If you do figure out what's going wrong, please let me know.
RobP
Posted on
Nov 28 2014
Yeah, I downloaded the source code for both and noticed that the code is exactly the same so I can only guess it must be something in the WebAPI source that does things differently. If I do figure it out I'll be sure to post back!