locked
How to bypass proxy using WinJS.xhr or XMLHttpRequest?

    Question

  • Hello,

    How to bypass proxy using WinJS.xhr or XMLHttpRequest?

    Thanks

    Wednesday, November 14, 2012 3:07 AM

Answers


  • Hi kkkccc,

    For Windows Store javascript app, neither WinJS.xhr nor raw XMLHttpRequest component has exposed the webproxy configuration interfaces. If you're using c#/VB.NET for building the windows Store app, then you can try the HttpWebRequest class which seems keeps the webproxy configuration feature (or you can try accessing the default webproxy setting via WebRequest.DefaultWebProxy property).

    #WebRequest.DefaultWebProxy Property
    http://msdn.microsoft.com/en-us/library/system.net.webrequest.defaultwebproxy.aspx

    One possible chance for javascript app is that we might create a windows runtime library via .NET or c++ can encapsulate the web proxy setting code in the winRT library and use the library in javascript app. The following free book has provided lots of useful information on this:


    #Free ebook: Programming Windows 8 Apps with HTML, CSS, and JavaScript (First Preview)
    http://blogs.msdn.com/b/microsoft_press/archive/2012/06/04/free-ebook-programming-windows-8-apps-with-html-css-and-javascript-first-preview.aspx


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by kkkccc Tuesday, November 20, 2012 2:24 AM
    Monday, November 19, 2012 8:55 AM
    Moderator

All replies

  • Hi,

    Do you mean cross domain question?


    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com
    Microsoft One Code Framework

    Wednesday, November 14, 2012 3:21 AM
  • Hi,

    I Configured a Proxy Server in Internet Explorer.

    But I want to connect network directly in my metro application.

    Could I bypass the proxy to connect network?

    Thanks


    • Edited by kkkccc Wednesday, November 14, 2012 7:00 AM
    Wednesday, November 14, 2012 7:00 AM
  • Hi,

    Then I think there is no way to do that.


    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com
    Microsoft One Code Framework

    Thursday, November 15, 2012 7:37 AM

  • Hi kkkccc,

    For Windows Store javascript app, neither WinJS.xhr nor raw XMLHttpRequest component has exposed the webproxy configuration interfaces. If you're using c#/VB.NET for building the windows Store app, then you can try the HttpWebRequest class which seems keeps the webproxy configuration feature (or you can try accessing the default webproxy setting via WebRequest.DefaultWebProxy property).

    #WebRequest.DefaultWebProxy Property
    http://msdn.microsoft.com/en-us/library/system.net.webrequest.defaultwebproxy.aspx

    One possible chance for javascript app is that we might create a windows runtime library via .NET or c++ can encapsulate the web proxy setting code in the winRT library and use the library in javascript app. The following free book has provided lots of useful information on this:


    #Free ebook: Programming Windows 8 Apps with HTML, CSS, and JavaScript (First Preview)
    http://blogs.msdn.com/b/microsoft_press/archive/2012/06/04/free-ebook-programming-windows-8-apps-with-html-css-and-javascript-first-preview.aspx


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by kkkccc Tuesday, November 20, 2012 2:24 AM
    Monday, November 19, 2012 8:55 AM
    Moderator