user3027344
user3027344

Reputation: 1

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.

Upvotes: 0

Views: 439

Answers (1)

samwu
samwu

Reputation: 5185

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

Upvotes: 0

Related Questions