0

I want to do a connection between a computer simulating being a server and another computer being a user, both with Linux.

In the first computer I've created a directory called "server" and in that directory I've done the following command:

python3 -m http.server 8080

Then I can see that directory going to the localhost. But what I want is to see that localhost from the other computer, I tried with wget, and the gnome system of sharing files but none of them worked, and I'm not seeing any solution online.

Nova Abacaxi
  • 1
  • 1
  • 2
  • Does this help? https://stackoverflow.com/a/9682497/6352720 – importnumpyasnp Mar 19 '21 at 13:08
  • Does this answer your question? [How do I connect to this localhost from another computer on the same network?](https://stackoverflow.com/questions/9682262/how-do-i-connect-to-this-localhost-from-another-computer-on-the-same-network) – General Grievance Mar 19 '21 at 13:57
  • If by localhost, you mean the standard `127.0.0.1`, which is the standard for the localhost terminology, you cannot. Any address in the `127.0.0.0/8` address block can never appear on any network, anywhere. Trying to connect to an address in that block will loop back inside the sending host. – Ron Maupin Mar 19 '21 at 14:19

3 Answers3

0

I'm not sure I fully understand your question but if you want to reach your folder from an other computer with your command python3, you can use the option -b followed by an IP address used on your linux.

Charles
  • 54
  • 2
0

All you need to do is get the IP of the server using ifconfig command. ifconfig | grep 192 make sure not to use the broadcast address part.

Now logon to the other machine and hit the command

http://192.168.71.145:8080

And it should work. Here I have assumed that your IP is 192.168.71.145 and the port is 8080.

Just change the IP and port as per your values.

vijaydeep
  • 395
  • 3
  • 12
  • I can do it but in my own virtual machine which uses the same IP, what should I do to make it work for another computers outside my network? – Nova Abacaxi Mar 19 '21 at 15:57
  • After learning about that VM it doesn't have an IP except you configure it in VirtualBox it worked everything, thanks! – Nova Abacaxi Mar 19 '21 at 17:30
0

If I'm understanding your question correctly you want to connect to the server from another machine on the same network.

If so you can run hostname -I on the server to output to the local IP address of the server, you can then use this on the other machine to connect to it (provided they are on the same network)