ERR_ADDRESS_UNREACHABLE to opening my localhost in Chrome Android - javascript

I´m using the task BrowserSync of Grunt, this task launch my local project to the url "localhost:3000".
This works fine. But when I use the External url (http://192.168.1.129:3000) in my smartphone, I get the following error of my browser Chrome in Android:
ERR_ADDRESS_UNREACHABLE
I don't understand this problem. You can see here my Gruntfile.js:
//Gruntfile.js
module.exports = function (grunt) {
grunt.initConfig({
//Watch task config
watch: {
},
//BrowserSync
browserSync: {
default_options: {
bsFiles: {
src: [
"css/*.css",
"js/*.js",
"*.html"
]
},
options: {
watchTask: true,
proxy: "tutorialmaterialize.dev"
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-browser-sync');
//Default task
grunt.registerTask('default', ['browserSync', 'watch']);
};
how can i fix this?, thanks you very much.

your IP starts with 192.168 which means this is a private network.
Only devices on the private network can access it.
Your phone will need to be on the same network.
You can check this by checking the first 3 digits of your phone's IP - the first 3 digits must be the same - if they begin 192.168.1.NUMBER then its on the same network. If not then its on a different network and you need to get them on the same network.
If they are already on the same network then ensure that port 3000 is open on the firewall, both the router firewall AND the firewall running on the machine you are accessing.

if your port of the server is 3000
and chick for your ip in cmd by this ...: ipconfig
ip4 : 192.168.11 than add it in mobile and on the desktop way view
example
on your mobile chrome
http://192.168.1.11:3000/

I had this problem using Chrome on my Ubuntu 18.04; I solved by installing a firewall manager (Firewall Configuration) and freeing the 8080 port. On your case would be port 3000 but the process is the same.
https://imgur.com/a/Swl3QDQ

For some router after both my mobile device and my PC are all the same network and also off all firewall for testing.It not work at all.
Finally I have had solved it by pinging test from the PC side first. After that my android phone can be access to my local web server.
I think that the real issue may came from WIFI access point device configuration.

Related

Nuxt js serve dev does not load when accessed remotely from another device

Nuxt js serve dev does not load when accessed remotely from another device.
Locally it works perfectly.
However, when I access the tablet, the nuxt address is running. An infinite load is shown.
server: {
host: '0',
port: '3030',
https: {
key: fs.readFileSync(path.resolve(__dirname, 'server.key')),
cert: fs.readFileSync(path.resolve(__dirname, 'server.crt'))
}
}
Tried with and without https and the scenario is the same.
This error is shown after a long time of loading.
https://10.0.0.108:3030/_nuxt/commons/app.js
net::ERR_CONTENT_LENGTH_MISMATCH 200
Someone could help. I am very grateful for the attention of the community.
Strong hug
Resolved.
It was some anomaly in the network settings. I used the windows network reset option and it worked.
Thank you all for your attention.

running a Development server on NextJS (on the network)

While using ReactJS, when we use the command npm start, It starts the development server on localhost:3000 and also on the network, 192.168.1.2:3000
This was super easy, I could test my app on all the devices by going into that address.
Recently I started learning NextJS and when I run the command npm run dev, I only see that it starts the development server on the local machine, not on the network. Is there a way to make it work just like it did with pure reactjs?
It also listens on your local IP, just find out your local ip and do "192.168.1.x:3000" -- this would be your IP , you will see the server running on that port.
To find local IP:
Open your terminal and run the command ipconfig for windows or ifconfig for MacBook. You'll see the network you're currently connected to, the IPv4 address being the current local IP address.
As #Deepinder Singh mentioned, Next.js dev server already listens on your local network.
To get your local network IP address run the following command. (tested only on mac)
ipconfig getifaddr en0
Mac/Linux
To find your local IP easily, you can use:
ifconfig | grep 'inet '
Then if you're on the same network, just navigate to http://YOUR_LOCAL_IP:3000
I can see you may be confused by the addres "0.0.0.0" you're seeing. But kindly go to your terminal and check your local ip address using the following command
ipconfig
then check the IPV4 address you see and use it instead of "0.0.0.0" and you're good to go.. for instance "192.168.43.131:3000"

network request failed when running expo app on android device

I am using a localhost server for my app development on expo. I get this error on my android device.
My server and api works fine as I have tested it on postman. It works well in the browser too. I am already using my ip address in the fetch function instead of localhost.
The fetch also works fine on genymotion android emulator. The issue is only on my actual android device.
Thanks
Solved the issue finally. The issue was my firewall(ufw) which was not allowing access for public ports.
sudo ufw allow from 192.xxx.x.xxx to any port 80 helped me as it allows acces to publicly open ports.
Thanks

Make sails.js listen for remote connections

I want my development environment to be accessible from remote connections as well as local. I have changed my local.js config file to listen on port 80 and host 0.0.0.0.
netstat -ab | more output:
Port forwarding:
And my firewall is disabled. however, the app is not accessible via browser and remote IP, nor can it be seen by http://canyouseeme.org.
All the command prompt windows are run with lifted privileges.
I currently don't have the option to run it as --prod if that would change anything.
EDIT: Tried fixing problems with production environment, and running as --prod, still same problem. Also tried setting up the simplest possible node.js server, and it also had this same problem, which leads me to believe, that it's problems with my router, and not sails.js. Any ideas, what could be preventing this?
Let's make your app listen on another port (for example 1337) then forward traffic from port 80 to port 1337.
Another way, you can use Nginx in front as a reverse proxy. By this way, Nginx will handle traffic on any port (80 as your requirement) and forward to your Sails app.
Hope this helped!

Grunt hostname 0.0.0.0 access is denied

I'm wanting to view my SPA on a few different devices on my network, so in my Grunt file I changed the hostname to '0.0.0.0' as Grunt instructs, my connect task/object now looks like this:
// The actual grunt server settings
connect: {
options: {
port: 9000,
// Change this to '0.0.0.0' to access the server from outside.
hostname: '0.0.0.0',
livereload: 35729
},
Now when I run grunt serve the app opens the browser at http://0.0.0.0:9000/ however my application isn't shown, I am given the following Error:
ERROR
The requested URL could not be retrieved
The following error was encountered while trying to retrieve the URL: "http://0.0.0.0:9000/"
Access Denied.
Access control configuration prevents your request from being allowed at this time. Please contact your service provider if you feel this is incorrect.
Does anyone have any ideas on what I should do to fix this issue. I have tried using hostname: '*' but that doesn't do anything but how the same error.
I am developing on OS X 10.9.2
Thanks in advance
Setting hostname to '0.0.0.0' is correct. You can connect to your server by connecting to http://localhost:9000. Alternatively, you can use the output of hostname to connect with the machine. Optionally, you should also set the baseUrl variable in your tests to connect to
I have the same problem. It seems that the '0.0.0.0' setting allows you to call your site from outside your computer; but screws the call to the web browser asking it to load a page located in an invalid server "http: / / 0.0.0.0"
If you replace the address to the right server name instead of 0.0.0.0 it will work.
You can set your own ip address instead of the 0.0.0.0.
With this grunt launch the server on your ip. You can use your mobile to.
The livereload will work on your desktop and on your mobile.
It's not the best way if your work by team because each one have his ip address but it's good enough if you work alone.

Categories

Resources