react native windows app not connecting to localhost - node.js

I have been working on react-native for windows app the thing is I created a localhost in node.js using express and made api calls from the windows app both the server and app were working fine on my device even after when i created appx bundle file and installed it on my computer then i shared the appx bundle file and my localserver file with my friend and it was causing problem there. Localhost was working fine i could make requests via postman but was not able to do so via the app it gives
Error : Network Error
. I am looking for some help if anyone have any idea about what could be going on.
Note that everything works fine on my development device

Related

vite can't open webapp running on linux machine from other devices ERR_CONNECTIONS_TIMED_OUT

I'm building a React web app using vite on my laptop(linux) and trying to access its URL though local network (like http://192.x.x.x:3000 on my computer (windows) or phone(android), but I can't open the page(ERR_CONNECTIONS_TIMED_OUT), also I can't open others projects this way, but I can open that url locally on laptop
When I was using windows 10 on laptop long ago and doing website with gulp I could expose page url the same way and simply open it on phone without any other configurations. So the question is what should I do to configure it properly?

Expo Mobile application for testing expo app not connecting to my server

I am building a React Native application with Expo CLI and I have the Android studio installed to test the app live.
I was able to use Expo Android app to also see the look of the app on my Android phone. Unfortunately, I use WIFI that generate random IP.
My IP changed two days ago and I had to update the BASE URL of to connect to my server instead of using localhost.
Since I did that, I was able to make API requests on my laptop but I can't seem to make API requests on my Android phone that is running the Expo android app.
I have cleared the cache and even cleared the data of my Expo Android app, but I still can't reach my server.
Only the client content starts. All API requests are not reaching the server on my Android phone but reaches the server from my laptop.
How can I fix this?
My local url looks like this:
const BASE_URL = "http://myIP:5000/api/v1";

Connecting to VPN in emulator causes problem React Native

I have a project which should be connected to API through OpenVPN. I am connecting successfully but when I try to run react-native start it does not find the app and starts that. I have tried many solution but did not work for me. See screenshots below:
error in react natice
error in CMD, node.js

SwaggerUI doesn't work after I deploy to IIS

I developed an .net framework WebApi and integrate the SwaggerUI. It works in my local IIS express.
Then I deploy my project into a local folder restapi and I copy this folder to my remote IIS server and configure it. The webpage is running well bet the SwaggerUI doesn't. Here is the screenshot:
The error message is:
500 : {"Message":"An error has occurred."} http://myserver:80/swagger/docs/v1
What could be the reason? Don't know where to start to fix the issue. Can anybody help? Thanks.
By the way, I'm using Swashbuckle 5.0.

Connecting to and syncing with localhost from android device not working

I am using the Azure Mobile App quickstart ToDoList example to get started with cross platform app. I have set up the back-end and it is working on localhost - I can hit it using Swagger and gets posts etc are working.
I then set up the client application (Xamarin.Forms). I am running the client application on my Android device and all works great when back-end is in Azure, including the offline sync element. The problem is that I have to work locally for now but I cannot sync with the db when running on localhost.
At first the debugger was giving me a "connection refused" error, so I followed the steps here and in various other sources including using my laptop IP and setting firewall rule, adding binding to port in IIS Manager and applicationhost.config, and changing ApplicationURL in Constants.cs.
Now, I get no connection refused error, but the data is not getting to the db, athough the localdb on the tablet seems to be working - it is failing when I try to sync to/from db.
Not too familiar with networking but it may be important to note that when I use localhost:portnum/tables/todoitem in browser I get results in XML but when I use 192.168.0.10:portnum/tables/todoitem I get "Bad Request - Invalid Hostname".
By default, your Mobile App .NET server backend application will run in IIS Express. This is problematic when debugging with a client application running in another device on your network, or in a virtual machine in Hyper-V (such as Windows Phone Emulator). IIS Express will host your server application under localhost, which makes the application unreachable to other devices or virtual machines. Your client application running on Windows Phone Emulator has a different meaning for localhost. The same is true for the Visual Studio Emulator (which runs in Hyper-V) and the Google Emulator.
It is simpler to configure your machine to host your Mobile App .NET server backend application on IIS, as this allows you to control the binding of the server application to an IP address, rather than localhost.
For information on this, see: https://github.com/Azure/azure-mobile-apps-net-server/wiki/Local-development-and-debugging-the-Mobile-App-.NET-server-backend

Resources