locked
retrieve local proxy setting via getProxyConfigurationAsync RRS feed

  • Question

  • I'm using javascript to developing Windows Store app. I'm having trouble in using getProxyConfigurationAsync() to retrieve local http/https proxy settings. My codes are sth. like these:

    var uri = new Windows.Foundation.Uri("http://localhost");

    Windows.Networking.Connectivity.NetworkInformation.getProxyConfigurationAsync(uri).done(myOnDone, myOnError, myOnProgress);

    But none of the 3 callbacks got called. I also tried 127.0.0.1 with no luck.

    I'm not sure if I'm doing this right, especially about uri part. Is there any sample code to show the usage of getProxyConfigurationAsync()? And even myOnDone callback got called, I've no idea about where I could get proxy info.

    Any advice? Thanks!

    Saturday, October 27, 2012 12:11 PM

Answers

  • I finally figured out. uri should be the destination that you want to connect to. myOnDone will get called and arguments[0] will have boolean flag canConnectDirectly and array proxyUris which contains proxy settings.

    Hopefully it helps who will be struggling with such stuff...

    • Marked as answer by ofox.cn Sunday, October 28, 2012 1:16 PM
    Sunday, October 28, 2012 1:15 PM