Reputation: 37
UWP side-loaded app doesn't listen for localhost server (port 9001 in this case). We checked using the WebSocket project from UWP samples on GitHub https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/WebSocket
I took that sample, packaged it and then installed on another PC using the package created. My observation was UWP app connects to localhost in my machine in which it was packaged, while it doesn't connect to localhost on the machine where it was side-loaded.
Please clarify the following queries: 1. Is it possible that currently UWP apps don't listen to localhost server 2. If it is possible, please suggest what we should do
I created the server using python web socket server from GitHub https://github.com/Pithikos/python-websocket-server
Upvotes: 2
Views: 457
Reputation: 21
By default, UWA's cannot access localhost. When deploying via VS, this constraint is bypassed for you. Otherwise, in the case of a sideloaded app, you must use the checknetisolation tool to configure an exception.
In your case, the command would look something like this:
checknetisolation loopbackexempt -a -n=Microsoft.SDKSamples.WebSocket.CS_8wekyb3d8bbwe
For more information, see the answer in UWP Enable local network loopback.
Upvotes: 0