Loopback enabled UWP app successfully reach localhost service only when Fiddler is running - loopback

For develop purpose only I'm testing a UWP (Universal Windows Platform) client app locally on my Windows 10 Laptop, where a WebAPI service is running.
By default, WinRT apps cannot connect to localhost but Visual Studio locally deployed apps should, but I coudn't manage to succeed.
Then I've used Fiddler to check and eventually enable loopback ability for my UWP app and found that it was already enabled.
By accident I've discovered that only while Fiddler is running, my UWP app can connect to the WebAPI service.
I'd like to know why.

Fiddler is able to Allow your App to use the local network loopback.
Simply check your App and you can reach your WebService.
You will see if you uncheck your App, you won't reach your WebService again.
Visual Studio enables the local network loopback while debugging as well if you check the option in your Projects Debugging Properties. (Project -> Properties -> Debugging -> Allow local network loopback)

Related

Deploying PWA server with offline support in intranet

I am developing an application that needs to be delivered as following:
PWA application server(Host app/IIS) is installed in the local network
PWA should support offline
Domain SSL not possible on the server as it's not a domain
Un attended installation
No configuration should be forced on the client machine, to change chrome settings etc.
I have tried:
Running from VS, Only works on same machine by design
Published to IIS and tried, works ok on the same machine. Offline does not work on mobile
Self sign SSL is not helping, Offline does not work
One option I found is to host it on our server on the internet, after installation access data from intranet server. Not yet tried this.
Looks like it is impossible to deploy PWA as intranet application with self-sign SSL. Am I missing something ?
Is there a way to automate deployment of PWA with self-sign that supports offline working?

Debug RESTful service from external device, unfamiliar error message

I have been working on a RESTful service (with VS 2015) for about 4 months now, on a Windows 7 development laptop (I don't know if Windows 7 is playing a role here, but I mention it for completeness).
I just purchased a new development machine with Windows 10. I copied my code to that machine, installed VS2015, etc (re-created my development environment).
When I right-click the service project and select Debug->Start new instance, everything works fine, and I can interact with the service from a browser using "http://localhost:[port]/api....."
However, I wish to interact with the service via my android app, that I am developing. I followed the instructions here:
http://becdetat.com/access-iis-express-from-another-machine.html
Namely, I ran the "netsh" command, made the necessary changes to applicationhost.config, etc. On my Windows 7 machine, this worked great and I was able to develop my mobile app.
However, on my new machine, the command:
netsh http add urlacl url=http://192.168.xx.xx:[port]/ user=everyone
causes me to get an error when I attempt to start the service in the debugger. The error is "There was a temporary DNS error. Try refreshing the page. Error Code: INET_E_RESOURCE_NOT_FOUND"
If I then execute:
netsh http delete urlacl url=http://192.168.xx.xx:[port]/
the service runs fine, but I still cannot access it from my android device.
As I mentioned, this worked just fine on my Windows 7 machine.
Thanks for any help.....

UWP Sockets Unable to Connect Over LAN

I am having some issues with sockets in UWP.
I'm trying to test some simple socket communications (stripped down version of the MSDN example) between a mobile and a desktop on the same LAN subnet. I am developing in a VM (on a separate desktop) and can deploy to the VM and mobile. In that case connections work fine.
When I create an app package and install it on the desktop, I cannot connect.
I have windows firewall on the desktop completely off. The VM is set to have a separate IP on the network. I have checked all IPs I'm using are correct.
I am getting the typical: A connection attempt failed because the connected party did not properly respond after a period of time
This is driving me crazy, if anyone has any helpful advice that would be much appreciated!
edit: To clarify the above.
My app has both both client and server roles (can connect to a listener, and is also listening itself).
App (on Mobile) --> App (on VM, deployed from VS) - this works fine, Mobile can connect to VM no problem.
App (on Mobile) --> App (on Desktop, installed from appx) - Mobile unable to connect to Desktop. Firewall on desktop disabled. Task Manager shows .exe listening on the correct port.
Thanks, Inci
Found a solution to this - it appears connections over LAN need to have the Internet(Client & Server) capability selected.
I am most certainly connecting over my local network (specifically 192.168.0.15 (mobile) to .21 (desktop). It seems that when deploying with VS the app doesn't need the Internet capability.
If there is a more 'correct' solution I'll amend this.

iphone app private test network

I am developing an iPhone app that relies on a custom web service I created using Ruby on Rails. I want to setup a test server on my Mac without having to change the URLs that my app is pointing to - served by the RoR service. This way I can test new features or fixed bugs more easily using the test RoR server.
I have enabled internet sharing on my Mac so I can connect with my iphone to a private wifi network. I installed dnsmasq and edited my /etc/hosts file to resolve my web service URLs to the local gateway ip. However when I use my iphone app the URLs are resolved to the production server instead of my test server (my Mac).
How do I setup dnsmasq to point to the local ip.
Thanks!
Have you set the DNS server address on the iPhone to the IP address of your Mac?
After playing with it some more I was able to get it to work. I needed to edit /opt/local/etc/dnsmasq.conf and change the 'address' tag. I also had to change my Mac ethernet settings, under advance->dns I had to add 127.0.0.1 as the first dns server. This will automatically change resolv.conf which is not meant to be edited manually on a Mac.
After reading up a bit on the Dnsmasq solution, I found a nice step-by-step guide for Mac: http://davesouth.org/stories/how-to-set-up-dnsmasq-on-snow-leopard-for-local-wildcard-domains
(although personally I use Fiddler in a Windows VM for all of this sort of thing - ask if you'd like some details on that..)

asp.net application calling a web service

I have a web application which calls a third party web service to return data which is then populated to a gridview.
When I run it locally from the visual studio built in IIS, it works fine.
When I publish to our servers and try to repeat the same action, it times out. I have checked all possibilites...if it is running locally, what happens when it gets published to the server machine.
Is it possible that your production machines may have a more strict firewall configuration that is disallowing outbound connections? Or maybe only allowing connections to whitelisted IPs?