when using the command
python -m Http.server 8000 --bind 192.168.1.105
the server serves the localhost only even after binding with the device address
I've tried binding with 0.0.0.0
python -m Http.server 8000 --bind 0.0.0.0
but nothing changed
and there is no VPN running on the device
I'm working on windows platform and trying to access the server form a mobile phone and a Linux platform
I keep getting a message from the client's device browsers that say the address is unreachable
Related
I was requested to create a Web Server with an API in it to test firewall rule we are planning to implement soon. I am quite new with all this network stuff, so I'm a bit lost on it.
I need to call this API from another machine. The JsonServer is using my port 3000, when I request my API through Postman, using https://localhost:3000/posts, my JSON file is returned normally, however when I change the localhost, to my IP, my connection is being refused. I decided to install a WebServer, to test it and I could access the default Apache page from my others machines. I opened the port 3000 on my server, but I couldn't. The WebServer is working with my IP as well. It seems to be something with my port 3000, and I a not sure about how to fix that.
I executed the command:
sudo lsof -i -P -n | grep 3000
And this was my output
node 29472 user 22u IPv4 254348 0t0 TCP 127.0.0.1:3000 (LISTEN)
Any ideas how can I access my API from another machine?
I have a node-server running at WSL2 Ubuntu-20.04.
netstat -tulpn in WSL shows the following ports:
The ports specified as 0.0.0.0:8080 can be accessed in both WSL and Windows via 127.0.0.1:8080 url
My issue is that the ports specified as :::3006 can be accessed via 127.0.0.1:3006 only inside WSL, but from Windows, it works only via the network URL like http://172.28.100.200:3006.
When I send the request to 127.0.0.1:3006 from Windows, there is no connection error, but the server inside WSL does not receive it while using the network address, it does.
How can I investigate this and make the Windows port at 127.0.0.1:3006 forward requests into the same port in WSL?
UPDATE:
So I solved this by adding a port proxy, but again, WSL network IP is needed for this to work:
Any chance to avoid using network IP?
Suppose if my ip address is : 192.65.35.12. In this machine I'm running node server. I can access the webpages by using this url: http://localhost:3000/ in the same machine.
But, if I'm trying to access the node server from a remote machine having the ip 192.65.35.11. It does not work. I used the below url to access the url from the remote machine:
http://192.65.35.12:3000/
I'm facing network connectivity issues.
Do, I need to change any settings in node.js for remote access.
Then, how can I access the node server from the remote machine.
Use this IP 0.0.0.0 to open your app on all interfaces provided by your computer.
On linux server you need to open port for outside client to reach it.
$ sudo iptables -I INPUT -p tcp -m tcp --dport 3000 -j ACCEPT
$ sudo service iptables save
$ sudo service iptables restart
Then start your server
I am running an Eve instance on my Linux webserver to allow me to access a database using HTTP. When I run the script, the following is displayed:
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
lsof -i :5000 yields
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
python 11824 root 3u IPv4 10213572 0t0 TCP localhost:5000 (LISTEN)
Trying to access http://goodenough.io:5000 doesn't work. I have this working on localhost on my Windows, but it just won't work over the internet.
http://www.yougetsignal.com/tools/open-ports/ shows that the port is closed despite the app listening and Digital Ocean claiming all ports are open by default.
But my new theory is that perhaps there is more to having external requests recognized?
Any ideas or suggestions would be amazing. Thank you.
In your application, there must be some code like this:
app = Eve()
app.run()
This will listen on the loopback interface by default. To listen on a specific IP address (the externally visible IP in your case), use:
app.run(host="X.X.X.X")
where X.X.X.X is the relevant IP.
I added the --address=0.0.0.0 to GAE arguments in eclipse.
From the same machine I can access the server with:
http://192.168.1.7:8888/createUser.html
http://localhost:8888/createUser.html
http://0.0.0.0:8888/createUser.html
http://127.0.0.1:8888/createUser.html
However if I try to access it from an Android device on the same LAN through http://192.168.1.7:8888/createUser.html I get an "Oops!".
The Android device can ping 192.168.1.7 and vice versa.
I'm using Linux and I don't have any firewall. What's the solution?
Thank you.
EDIT: I also tried to access the page from another PC in the same LAN but didn't work. I also tested the port using telnet: it works from the machine but doesn't work from other devices in the same LAN.
The solution is to open the port 8888 using this command:
sudo /sbin/iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 8888 -j ACCEPT