Answered by:
Loopback address capability needed to grab data from a backend app!!

Question
-
I have found that loopback capability is restricted for metro app?? I need to be able to ship a metro app that can grab data from a service/app sitting on the same machine. How can i do this, with websockets, or xhr ?? Note i am pointing to localhost:8080/ .
Any way of getting this done is appreciated.
Monday, March 5, 2012 10:00 AM
Answers
-
Hi V,
If you search the forums for localhost you will find some of the previous discussions on this. This was a design decision made early on for a couple of reasons. In a nutshell, Metro style apps have to be self contained with no external dependencies. Your design would break that (it needs a service installed on the local machine). You can move that service to the cloud or have a service on the cloud to be an intermediary if you wish. Also there are security concerns when you open localhost. Metro style apps are designed to be sandboxed and isolated.
-Jeff
Jeff Sanders (MSFT)
- Proposed as answer by Jeff SandersMicrosoft employee, Moderator Tuesday, March 6, 2012 1:15 PM
- Marked as answer by Jeff SandersMicrosoft employee, Moderator Friday, March 9, 2012 1:50 PM
Tuesday, March 6, 2012 1:15 PMModerator
All replies
-
Hello.
Well, loopback in the beta is opened when you create a new project in VS. I'm assuming that you can enable it in another pc by using the checknetisolation tool. This post was written during the developer preview, but it should still work with the beta preview:
http://blogs.msmvps.com/luisabreu/blog/2012/01/05/windows-8-adventures-getting-external-data-from-a-local-server-might-not-be-as-easy-as-you-expect/
Luis Abreu
- Proposed as answer by Jeff SandersMicrosoft employee, Moderator Monday, March 5, 2012 4:12 PM
Monday, March 5, 2012 11:55 AM -
You will not be able to ship an app that goes to localhost. This is by design.
http://msdn.microsoft.com/en-us/library/windows/apps/hh452759.aspx
See the section:
Network isolation and enforcement
Jeff Sanders (MSFT)
- Proposed as answer by Jeff SandersMicrosoft employee, Moderator Monday, March 5, 2012 4:21 PM
Monday, March 5, 2012 4:21 PMModerator -
Jeff, but are we talking about an app that is going to be published to the windows store or about a local app? I'm not really interested in developing for the windows store (at least, not for now), but I'm seeing myself in a near future developing winjs apps for internal use and there are some cases where I'll need to get info from localhost (probably by using machine name, but in some cases that will be the same as localhost since we've got some sites running in pcs which are also used as user machines - low budgets, etc, etc...not nice, but that's the scenario I've got)
Luis Abreu
Monday, March 5, 2012 10:58 PM -
Is this something we can have a discussion about with the right people in msft? Or have it controllable by a user side setting,etc. Otherwise you are seriously limiting yourself.
Tuesday, March 6, 2012 1:44 AM -
Hi Luis,
The document I listed pertains to the Store. Note that the workarounds published are for development and testing scenarios though, and not transparent to deploy.
-Jeff
Jeff Sanders (MSFT)
- Proposed as answer by Jeff SandersMicrosoft employee, Moderator Tuesday, March 6, 2012 1:15 PM
Tuesday, March 6, 2012 1:11 PMModerator -
Hi V,
If you search the forums for localhost you will find some of the previous discussions on this. This was a design decision made early on for a couple of reasons. In a nutshell, Metro style apps have to be self contained with no external dependencies. Your design would break that (it needs a service installed on the local machine). You can move that service to the cloud or have a service on the cloud to be an intermediary if you wish. Also there are security concerns when you open localhost. Metro style apps are designed to be sandboxed and isolated.
-Jeff
Jeff Sanders (MSFT)
- Proposed as answer by Jeff SandersMicrosoft employee, Moderator Tuesday, March 6, 2012 1:15 PM
- Marked as answer by Jeff SandersMicrosoft employee, Moderator Friday, March 9, 2012 1:50 PM
Tuesday, March 6, 2012 1:15 PMModerator -
There are legit use cases to get this going. Who would be the right person/business manager/program manager to have a discussion with?Thursday, March 8, 2012 8:19 PM
-
Hi V,
Thanks for the feedback. You can email me your concerns and scenarios by reaching me here: http://blogs.msdn.com/jpsanders/contact.aspx
-Jeff
Jeff Sanders (MSFT)
Thursday, March 8, 2012 8:38 PMModerator