local web server not accessible on Chrome - Android - android

I am trying to access my website (hosted on intranet) for testing on Google Chrome for mobile (using nexus 5) and the website is not accessible (on the same network using Wifi). If I access my website from any other pc on the same network it loads the webpage. I just checked that network connection is working fine and on my mobile i am able to browse any website on internet. I found the same behavior on android. Please guide me if there is any settings in android/chrome to access local server. The address of my webserver is like "http://my-server/webapp"

Related

Android WebView does not resolve private DNS without active internet, but browser does

My setup:
Hardware:
Ubuntu 22.04
WiFi router connected to Ubuntu
Several android devices accessing the Ubuntu machine over wifi.
No internet.
Software:
On Ubuntu - I run Nginx to serve some webpages, DHCP server, MaraDNS with Deadwood to provide DNS lookup. DHCP & DNS runs fine. The URL being served by Nginx has an entry in the DNS.
On Android I run a WebView based App that essentially fetches the webpage from ubuntu.
Problem:
When I access the webpage from Android Browser I can, but when I use Webview I get the following error:
Web page not available
The web page at https://mycustomurl/ could not be loaded because:
net::ERR_NAME_NOT_RESOLVED
Debugging attempts:
When I type https://mycustomurl/ on Chrome using the same Android device that runs my WebView based app, Chrome loads the page successfully. I have ensured that there are no SSL errors as I am using proper signed certificated. I have also used onSSLReceivedError handling in WebView.
On Android device using chrome://net-internals/#dns I tried looking up https://mycustomurl and it resolved successfully.
If there is active internet connection, webview doesn't complain. It is only when there is no active internet connection that I see the problem.

How to access url with hostname on laptop from android mobile app

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

Debugging HTTPS local services from my mobile device (web, api, websocket)

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).

How to serve my localhost server that runs on my android to my android hotspot clients?

I have my android phone that runs a node.js server/website.
I wonder how can I provide this website to anyone that connects to my hotspot.
In addition would be nice that for any URL to redirect to myurl.com and then serve that local website to anyone that goes to myurl.com.

Can't access local server url (my-computer.local) on android tablet

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?

Categories

Resources