HttpWebRequest.Proxy in Windows Phone 7?

2020-02-13 03:14发布

问题:

It seems that .NET Compact Framework does not include a Proxy property for HttpWebRequest.

Is there anyway, I can use proxy when reading from a HttpWebRequest?

回答1:

No this is not currently possible to do it programatically from within your application. In windows proxy settings are configured in internet explorer. On the phone you can configure proxy settings from Edit Network inside Settings, if you do this and you are connected to a WiFi network it will make the connection go via the proxy.

However if you really want to problematically opt to connect via a proxy from your application you could do this With Mango release. In mango you will have greater access to the networking stack, you would be able to connect to a proxy using TCP/IP using System.Net.Socket in the raw. You would connect to the Proxy and then construct the Http Header Manually, the response would contain the Http response via the proxy server.



回答2:

No currently you cant use a Proxy with WebClient or HttpWebRequest. With Mango you can use Sockets.