connecting to the server via wlan

This thread has been locked for further replies. You can start a new thread to share your ideas or ask questions.

connecting to the server via wlan

This thread has been locked for further replies. You can start a new thread to share your ideas or ask questions.
connecting to the server via wlan
connecting to the server via wlan
2021-09-11 20:51:16
Model: TL-WR841N  
Hardware Version:
Firmware Version:

hi!

i am running local server on my pc ( f.e. python -m http.server ), pc is connected to the router via cable, how can i connect to the server from android device which is connected to the router via wifi ( there is access to the internet ) ?

on my pc, i can connect to the server as http://localhost:8000


what address should i use in android device and should i configure the router to provide me access to the port 8000 or smh?

 

in DHCP Clients List i see ip addresses of pc and device

 

idk is it correct but i tried to edit Forwarding Virtual Server, enabling for the pc ip address the port 8000, no results.

 

from the device, when i am trying to connect to the pc ip address browser says ERR_CONNECTION_TIMED_OUT

 

i am very noobie help me pls thank you

 

  0      
  0      
#1
Options
5 Reply
Re:connecting to the server via wlan
2021-09-12 10:59:41 - last edited 2021-09-12 20:37:47

@kotya 

 

Since your PC is connected to the router via cable, while the Android phone is connected to its Wi-Fi, they are on the same LAN.

Hence there's no need to open ports in router Virtual Servers section - that is necessary if you want to access the server from outside your local network (from Internet).

From your phone browser you should be able to open the server URL at http://<PC IP address>:8000.

 

If this was helpful click once on the arrow pointing upward. If this solves your issue, click once the star to mark it as a "Recommended Solution".
  0  
  0  
#2
Options
Re:connecting to the server via wlan
2021-09-12 18:20:22

@terziyski  ok, there is my update.

first time i connect thru phone i am connecting as proxy or smh, i do not understand exactly but in this type of connection i cannot go to router settings from device via 192.168.0.1. btw i can modify device connection after proxy-connection to be dhcp connection. then, i can go to router settings using 192.168.0.1 on device. althrough i cannot connect to the server created on pc via python -m http.server using address 192.168.0.100:8000 from device, pretty sure this is my pc ip address ( my device address is 192.168.0.101 ). when i try to connect from device i have same connection-timeout error. connection on 192.168.0.101, localhost:8000 from device gives "connection is refuced". 192.168.0.100:8000, localhost:8000 from pc is ok. what may cause this scenario?

  0  
  0  
#3
Options
Re:connecting to the server via wlan
2021-09-12 21:11:22 - last edited 2021-09-12 21:11:57

@kotya 

 

I believe this behaviour depends on which interace you've bound your python http.server - look at this thred sloution and try to reproduce it.

If this was helpful click once on the arrow pointing upward. If this solves your issue, click once the star to mark it as a "Recommended Solution".
  0  
  0  
#4
Options
Re:connecting to the server via wlan
2021-09-14 14:07:58

@kotya That web server runs only on localhost.

Of course you wont be able to connect to it from another device/PC.

Set the server to bind to 0.0.0.0 or your LAN address, if you want to access it via LAN.

  0  
  0  
#5
Options
Re:connecting to the server via wlan
2021-09-22 02:06:09

@ku4eto

>That web server runs only on localhost

i do not understand actually why server runs only on localhost ( and how localhost differs from lan ), terminal says "Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...", but you are correct, i tried to run server using "npx http-server" and now it just works

 

thank you very much for helping me out (シ_ _)シ  @terziyski and @ku4eto 

  0  
  0  
#6
Options

Information

Helpful: 0

Views: 722

Replies: 5

Related Articles