tomkuijsten / restup

Webserver for universal windows platform (UWP) apps
MIT License
114 stars 48 forks source link

HeadedDemo is not accessible from a browser #64

Closed aquisio closed 8 years ago

aquisio commented 8 years ago

Apologies in advance: I realize that this issue has been discussed in a previous thread, but none of the recommendations in that thread have helped me.

When running HeadedDemo, either debugging from within Visual Studio 2015 or directly from Windows 10, it works fine. However, I am unable to access it from a browser, either on the local machine or remotely.

I have tried disabling the Windows firewall but it makes no difference.

I have also experimented with Fiddler and found that HeadedDemo stops working when Fiddler is running. In this configuration the HeadedDemo client receives a message back from Fiddler, indicating that its onward request to the server timed out.

Any suggestions please?

dm-CaT commented 8 years ago

Did you try to run demo using web server's source codes instead of NuGet packages?

Jark commented 8 years ago

Hello Aquisio,

Locally you can't access anything hosted by StreamSocketListener (which is used by restup internally), this is by design by Microsoft. In the HeadedDemo we get around by this because apps are allowed to connect to StreamSocketListeners hosted in the same process. See http://stackoverflow.com/questions/32665847/cannot-connect-to-streamsocketlistener.

Remotely you should be able to access the HeadedDemo, would you mind checking what you have got in your app manifest of the program you're trying to run?

image

Cheers,

Jark

aquisio commented 8 years ago

Hello Jark,

Many thanks for your very quick reply.

Yes, I'm sorry - you're right. The manifest is correctly configured (I cloned your GitHub repo) and it does indeed work remotely. I'm not sure what I did wrong in my earlier remote tests, but it is definitely working now.

Is there any workaround that will enable me to test my app locally from the machine that it is being developed on?

Thanks again for your support. Restup looks like an awesome project that is very much needed.

tomkuijsten commented 8 years ago

It's already documented in the Wiki, but probably not visible enough. I'll try to put it somewhere more visible for first time users.

Jark commented 8 years ago

Hello Aquisio,

Unfortunately I don't know of any way... I have tried the loopback exemption, but that apparently just doesn't work... (https://msdn.microsoft.com/en-us/library/windows/apps/Hh780593.aspx).

This is the reason why I expanded the HeadedDemo ui to include a way to test the local server, maybe you can do something similar? E.g. conditional debug statements that include the test ui?

@tomkuijsten I already added this info here before: https://github.com/tomkuijsten/restup/wiki/Limitations, but I think it can do with some expanding, and maybe a rename to FAQ that features a bit more prominently on the main page.

dm-CaT commented 8 years ago

I think it should be included somewhere on top of wiki. ;) I faced the same problem and spent about an hour to find the solution.

Jark commented 8 years ago

That seals it, seems the wiki needs a little bit of work done to it, I'll take care of it today.

tomkuijsten commented 8 years ago

Good, just created a custom menu. You can change it if you like.

aquisio commented 8 years ago

Thanks to everyone for your guidance. Now that I know about this limitation, it's easy enough to work around using 2 machines.

Jark commented 8 years ago

I've renamed the Limitations page to FAQ and have added to it: https://github.com/tomkuijsten/restup/wiki/FAQ, I've also added a CONTRIBUTING.MD so that when a new issue is raised they get referred to the FAQ first.

With this, I'm closing this issue.