- I want to use WWW with a Proxy in players (runtime), but it does not work. (Not WebPlayer)
If you use WWW with a Proxy in players (runtime, not WebPlayer) it may fail.
WebPlayer takes the Proxy settings from the browser automatically. Other players (runtime) work differently and cannot use a Proxy. Therefore you can use this workaround with the WebClient and WebProxy classes and still use the Proxy:
public class MyWebProxy : MonoBehaviour
string yourProxyServer = "yourproxyserver.com";// you can use "yourproxyserver.com:port"
WebClient client = new WebClient();
WebProxy proxy = new WebProxy(yourProxyServer);
// check proxy.Credentials property and NetworkCredential class if you proxy uses user/password
client.Proxy = proxy;
With this code, you can use WebProxy.Credentials and the NetworkCredential class to set user/password info.