Why cant I access my react app from another device? - node.js

So im trying to access my React web application with ipadress and the portnumber 3000. I tried from another computer and from another phone. But the webpage keeps on loading and then tells me it can't reach the website. Why not?
Here is the github link for my project:
https://github.com/darja2001/collaborative-whiteboard-SR

Make Sure Your Computer and Phone or computer are connected to same
network.
Open command prompt and type ipconfig and Copy Ipv4 address.
In your phone or another computer open URL http://(Ipv4 adress):(port
number)
And you will get it
Else you can also use ngrok to access your react app anywhere.

Related

Expo cant get data from json-server node.js

I recently started to learn react native. I have such a problem.
I launch the Expo application and it works I go to the subitem where the data is taken from the json server and there is empty. Writes a network request failed. As I understand data from the server is not read.
Here is more detailed.
First, run json server, type json-server --watch db.json -p 3001 at the command prompt. It all started. I’ll go into the browser and type localhos: 3001 / books. And the data appears. As I understand it answers the request.
Next, run react native. Everything loads, runs in the metro bundler browser (localhost: 19002).
There are three types of launching the program on the phone:
1.local and the address 127.0.0.1, as I understand it, it is needed to connect and run through the usb cable. I tried using this method the application starts. But the data does not appear. Writes a network request failed.
2.lan and the ip address of the computer, as I understand it through wi-fi. Since I don’t have a wifi router, I tried to give wifi from my computer. I connected a modem. And its began sharing wifi. I connected the phone and started it. It did not start at all. IP address of the computer in lan mode by default, takes IP address from the modem (192.168.8.100) and the phone (192.168.43.216). In short, the phone and the computer must be on the same local network. I think may be if I'll take another comp. It will be used as a Wi-Fi routet instead of a router. And then I’ll connect my working computer and phone to it. I configured ip addresses. Still not starting. I think that i did something wrong I am not an expert in local area networks. If you have any ideas, help.
3.tunnel did not quite understand how to use. I decided to share the wi-fi from the phone and make an access point. Connect my computer and ran. It seems to have started but still does not show data.
Please, help.
1) to form lan connection without wifi router.
2) how to read data from json server to the phone.
P.s. i killed 3 days trying to figure it out.
I copied the example from "Getting Started" in the README and then ran npx json-server --watch db.json -p 3001. I then went to http://localhost:3001/posts/1 in my browser and it worked as expected.
Next, I opened a new tab in terminal and ran npx ngrok http 3001 to expose create a tunnel to access the http server at port 3001 from anywhere. Once the tunnel started I saw the following information:
ngrok by #inconshreveable (Ctrl+C to quit)
Session Status online
Session Expires 7 hours, 58 minutes
Version 2.3.35
Region United States (us)
Web Interface http://127.0.0.1:4040
Forwarding http://ef4b99ca.ngrok.io -> http://localhost:3001
Forwarding https://ef4b99ca.ngrok.io -> http://localhost:3001
I opened https://ef4b99ca.ngrok.io/posts/1 in my browser and it worked as expected (this will not work for you when you are reading this because I will have closed the ngrok tunnel and my json-server by then).
If you follow these steps and use the tunnel URL in your app you will be able to access it in development from your device.

How can I share a website to a client in which I have built locally using MAMP but is not hosted yet?

How can I show a website to a client in which I have built locally using MAMP but is not hosted yet ?
Bring your Mac to the client, and show them the website.
Send them the html, php, javascript etc. files via email. Tell them to put the files in one directory and to run the main html file.
in your internet router, make a port forwarder, lets say 1333
make this port forward to your computer local ip address/localhost, ex 192.168.0.9/localhost
give your client the ip address and the port, ex 43.13.19.33:1333

If I use http-server with node can other devices on my network access it?

Background
I am building a site using angularjs and want to make sure that its displaying properly on my phone. I'm aware of the Google Chrome emulator but would like to show people it directly on the phone.
Node.JS
I'm using http-server . to run a server at the base of my app. This was the quickest and easiest way of getting a server for local testing.
I have tried going onto the same network via wifi on my phone and then trying to get to localhost:8080 but it just gives me a "this web page is not available" error
Question
My question is, is there a way to get my web app on my phone with http-server . or do I need to set up a proper web-server? I thought maybe it would just be simple to get it on any device attached to the same network.
Since our application(server) and devices(in which you want to access the application) running on same network.
You can access this with the help of IP address.
Let say, your app is running on
192.168.1.1:3000
So you can access it as localhost:3000 on local machine.
And as 192.168.1.1:3000 on devices which is using the same network.
any device can access to server. Use ip in device not use localhost
Use ngrok https://ngrok.com/ , ngrok expose your localhost behind a NAT or firewall to the internet , easy to use , after install just type on command line ;
ngrok 7070
then it gives you a link like ; 3g87g9g.ngrok.com
Use ifconfig utility if you are in linux or use any other tool to get the ip address of your phone (Web server), for example 192.168.1.10 is IP address of the phone.
You can access the web page from any other device in the network by going to 192.168.1.10:8080 in the browser.
Note that 8080 is the port to your server application, you select the port from node.js

Covert home pc to web server steps

I want to convert my home pc to a web server. Already IIS8 has been installed. The sample page has been published on default web site. In windows firewall the port 80 has been opened. I have access to this page through different computers that connect to the same ADSL router. However, when I try to connect to the page from another ISP, I get the error of 'web page not find'. Because I don't have static IP now, I find IP of the server from http://www.whatismyip.com/. I wonder if anybody help my to solve this issue.
One workaround it to use no-ip
http://www.noip.com/
this would give you static IP.
From this point is just normal domain setup.

What is the best way to test a video chat application locally?

If I am running a local server that is hosting a video chat application what is the best way to test the application with another user? Lets say I have two computers, is there a way I can allow computer B to connect to the local server that is running on computer A? The goal is to simply test whether the video chat application works properly in two completely different browsers running on separate computers. If there is a way I can trick the app into thinking the computer that is running the local server is another host, please let me know.
But Remember that the app needs access to the computers webcam. Thanks!
Addition Info: Nodejs application that uses the Tokbox, express, and socket.io APIs
Just make sure your web server is listening on a routable IP like "0.0.0.0", which you specify when you call http.createServer(port, ip, handler). Then point the browsers at the server's IP address such as http://192.168.1.1:3000 (fill in your specific IP and port). You can use the command ifconfig -a on linux or osx to get your server's local IP address, and ipconfig on windows.

Resources