开发者

How to hook up a mock proxy server?

My开发者_开发问答 sharepoint webpart is throwing an error on my client's environment when calling HttpWebRequest.GetRequestStream (and he's using a proxy server). The error is "unable to connect to the remote server."

What's the best way to reproduce this scenario (hooking up a mock proxy) on my end so that my requests go out through the proxy server as well? This will help to debug...


You can configure a proxy server in the HttpWebRequest object. As well as specifying the server address you can add any bypass addresses.

http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.proxy(v=VS.71).aspx

The proxy can also be specified in the config file. This may make it easier for you to test the solution.

http://msdn.microsoft.com/en-us/library/kd3cf2ex.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜