-
Connect your laptop and phone to the same network (Wi-Fi is a network too).
-
Create a
index.html
file to share:
<div>Hello!</div>
- Start a web server in the same directory as the file:
ruby -run -e httpd -- --bind-address=0.0.0.0 --port=9090
- Find your hostname, or ip address:
hostname
# my-pc
ip addr
# ... some wall of text, one line containing something like:
# inet 192.168.0.38/24 ...
- Now you can use either your hostname or ip address to access your web page from your phone:
http://my-pc:9090/index.html
http://192.168.0.38:9090/index.html
- Install
Termux
on your phone and do the exact same to access web pages from your laptop.