We have mobile apps installed on Android mobiles and ASP.NET Core web API application deployed on IIS server on Windows 10 Laptop / PC.
my Android phones and laptop are connected to the same WiFi network created with Mobile Hotspot on Laptop, we can reach the IP address from mobile and also able to call web api. (Note: we are not using Wifi Routers)
Scenario 1: Working scenario
Web API deployed with default settings and if access with laptop ip address we are able to hit api successfully.
But due to dynamic nature of the ip address on laptop we have to change ip address every time in mobile app. We would like to avoid this situation by using hostname.
Setting static ip address on laptop is also not solution for us. So we have planned following scenario.
Scenario 2: Proposed solution
Web api application deployed on IIS 10 on laptop, with following settings in IIS
Binding Section :
IP Address: All Unassigned
Port : 4041
Host name : xyz.com
Also made the entry in the host file as
127.0.0.1 xyz.com
Now I am able to access the Web-API from laptop browser with the URL: http://xyz:4041/.
When I use the http://xyz:4041/ on mobile browser I am getting error “the site can't be reached” & “refused to connect”
Pls help me to resolve this issue.
There are many reasons for this error, you can try the following methods to fix this issue:
1.Clear cache and cookies and try again
2.Reset Your Chrome Browser Settings
3.Restart the DNS Client
4.Change the DNS Servers
5.Flush the DNS Cache
6.Reset the TCP/IP Address
Related
I am building a Server-side Blazor web application on localhost for now.
I want to test my web app on android and IOS devices but I cannot seem to find the solution.
I have tried connecting to the same network via wifi and have my IP address with :port but doesn't work.
You could give ngrok a go, this would allow you to map your localhost and port to a public web address.
There are a bunch of details here:
https://ngrok.com/
Having a hard time debugging from mobile device my local development web app which connects to a GraphQL node server and another service using web sockets. All three services running on HTTPS to the below ports.
Web Reactjs app: https://localhost:3335
Node server: https://localhost:3334
Web socket server: wss://localhost:4443
From my macOS machine, everything works as expected but when trying to access the reactjs from Chrome Android and using the inspect desktop devtools and USB cable navigating to https://localhost:3335 works but I get the error POST https://localhost:3334/dev/graphql net::ERR_CERT_DATE_INVALID.
My iOS device doesn't even connect to localhost:3335 or 192.168.2.3:3335.
I am open to any tips, tricks, services, and ideas to debug using my local development machine and mobile devices.
I was able to make it work by navigating to all addresses in the mobile browser and accept the risk of a self-signed certificate.
https://localhost:3334/dev/grapqhl -> accept
https://localhost:4443 -> accept
Now https://localhost:3335 will work fine.
Struggling with iPhone debugging due to localhost not binding to the machine IP address (Pending solution, might create another SO question for reference).
I have configured a local URL on my mac (http://my-computer.local) to access a server I host on my mac, on a local WIFI network (offline).
I can access my server with this URL using other desktop computers and iPhones, but not on Android devices.
On the Chrome browser of my android tablets/phone I get the page:
You are Offline
ERR_NAME_NOT_RESOLVED
However, when I type the server's IP address directly in the same browser on the Android tablet, it works.
Why is the local URL not working only on the Android device and how can I solve this, and get it to work?
I want to learn client - server communication in Android. As per my understating, to communicate with the server we need a valid URL. My doubt is that, can I communicate Android mobile client with the local xammp server???? If yes, please explain me...
Thanks in advance...
yes you can do that if you are using android emulator then use http://10.0.2.2 ip address to access localhost, for genymotion use this http://10.0.3.2.
You can also use Google Chrome's port forwarding but you need google chrome on computer and emulator or device.
if you want to access localhost using port forwarding then open following address on google chrome chrome://inspect and enable port forwarding and set port and ip address.
I am trying to access a web role integrated with ACS from the Android emulator , the issue is that
during web role debug configuration , the ACS redirects back to "localhost" and not to a real URL.
Android emulator local computer localhost address is defined as 10.0.0.2 so when ACS redirects to localhost the emulator web browser fails to redirect.
I tried to let ACS redirect to 10.0.0.2 - but for some unknown reason it doesnt work.
SO! .... after few hours (50) I tried to use IIS 7 as a reverse proxy using Application Request Routing and to make the Android calls directly to my computers LAN ip address and let IIS to redirect the calls to the Azure local host web role :
So , the emulator calls 10.0.0.3:8081 and IIS7 will redirect it to localhost:8082 (which is the web role).
AND! .... after another few hours (280) , I am still investing so much IT time and cant check my web role.
So , now I am here , and hope that someone with expirence in those subjects can help me out .
Azure btw for those of you who do not know , can not be configured locally to publish itself on the local network and can only operate in localhost mode.
Thank you very much .
Ishai
Problem solved , instead of IIS 7 Application Requet Routing I have used Fiddler 2 Reverse proxy option to forward requests to my localhost web role.
Fiddler 2 is configured to publish itself in the LAN at localComputerIp:8888 - e.g. 10.0.0.3:8888 , so then from Android instead of trying to access 10.0.0.2 (localhost) : 8087 - my Azure web role direct address , I set it to connect to Fiddler direct LAN ip at 10.0.0.3:8888 and Fiddler forwarded the requests to localhost:8087.
This took me alot of time to accomplish and even though it might be simple if you have the right knowledge I hope other users will find this post helpful .