Blazor Server-side app Android and IOS mode - android

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/

Related

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

Test mobile web app in mobile device's browser using localhost

I want to test a mobile web app on mobile device. I am currently developing my mobile web app. It is still on my local environment i.e. localhost:8080. Now I want to use same hostname and port to access this web app on my mobile device. I need this because my mobile web app is also using HTML5 Accelerometer API. I need to test if it is working. I can use google chrome dev tools to emulate responsiveness but I need to test it on real device.
How can I test it on both Android and iPhone?
UPDATE
Below is my nodejs server code
'use strict';
var express = require('express');
var app = express();
app.use(express.static('./dist'));
console.log('\n0.0.0.0:8000\n');
app.listen(8000, '0.0.0.0');
As Rosário said, you can connect to the same Wi-fi network as your computer and type in the computer's IP in your phones browser.
I don't know how experienced you are so make sure that you..
a) Use your computer's local IP. E.g. looking up your own IP on www.speedtest.net won't help since this is your public IP.
b) Type in the port in your phones browser.
E.g. if your computer's IP is 192.168.0.10 then you need to type in http://192.168.0.10:8080 as the url in your browser.
Simply connect your mobile to the same Wi-fi network as your computer. And then Enter the Computer's IP on the mobile's browser.
Android app "KWS"
Its a good option to test webserver,

How to test my own ASP.NET Web API in localhost:port using android or Windows Phone device (no simulator)

I'm trying to develop my first REST Service using ASP.NET following this guide.
I'd like to test my services in localhost using my android and wp devices without using android and WP simulator (too slow).
Is there a way to do that?
If you deploy the ASP.NET app on IIS, the services will be reachable as long as the phones are connected on the same network (via Wifi for example). Just use the IP adress of the server instead of localhost.
Another idea is to use fiddler's proxy option. (This also assumes you have set up your app in IIS). Check out this article.
This approach is especially useful if you want to test using custom host headers over SSL.
With this approach you can simulate production dns (by altering hosts file on the fiddler host) rather than using IP addresses and machine names from the mobile device.

Debug Azure web role integrated with ACS from Android emulator web application

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 .

Categories

Resources