Answered by:
Websockets and localhost

Question
-
When I tried Websockets and localhost in a Metro app, I got a runtime error. However looks like I can use
CheckNetIsolation.exe LoopbackExempt –a –n=”PackageFamilyName”
to let your appl communicate through localhost. I assume this is just add some registry entry. Seems like Metro IE has this LoopbackExempt because there is a demo that show websocket working with Metro IE to a IIS running on the same machine. Is this a blessed way to do websocket localhost communication?
Thursday, November 17, 2011 8:13 PM
Answers
-
Hi D,
Metro IE is a special case.
-Jeff
Jeff Sanders (MSFT)- Marked as answer by dzungductran Friday, December 2, 2011 6:30 PM
Tuesday, November 22, 2011 8:24 PMModerator
All replies
-
Hi D,
CheckNetIsolation is used only for local testing. You will not be able to create a production application that talks to localhost. So bottom line: you cannot do localhost communications in Metro Style applications (you don't have a blessed way).
-Jeff
Jeff Sanders (MSFT)- Proposed as answer by Jeff SandersMicrosoft employee, Moderator Thursday, November 17, 2011 9:23 PM
Thursday, November 17, 2011 8:42 PMModerator -
Websocket works with Metro IE on localhost, so why is Metro IE special for this case. Websocket spec does not prohibit connection to any host even if it is on the same machine. If Metro IE works, why is my Metro HTML5/JS app can't connect on localhost. Also, you can use socket to connect from one Metro app to another Metro app on the same machine, why can't I have a Metro app connect to a desktop app on the same machine. I just think Windows 8 is inconsistent in its policy when it comes to this.
Thanks in advance for your response
Friday, November 18, 2011 5:10 PM -
Hi D,
Metro IE is a special case.
-Jeff
Jeff Sanders (MSFT)- Marked as answer by dzungductran Friday, December 2, 2011 6:30 PM
Tuesday, November 22, 2011 8:24 PMModerator