Simple HTTP Server

Simple HTTP Server


Simple HTTP Server with http.server

Open your terminal, change to the directory that will be shared. For example, we want to share our Music folder:

cd $HOME/Music

Write this command to run the server:

python3 -m http.server

If we want the server run on specific port, run the following command instead (custom port, for example 2408):

python3 -m http.server 2408

We will see following output when server successfully launched:

Serving HTTP on 0.0.0.0 port 2408 (http://0.0.0.0:2408/) ...

We can access it in browser with URL mentioned OR if we want to access from different device, check our computer’s IP address that run this server with this command (Linux):

hostname -I

or (Windows OS)

ipconfig

then access the server with http://your_ip_addr:2408/ (for example: http://192.168.0.123:2408/).

💬 Komentar

Real-time

⏳ Memuat komentar...

Tulis Komentar

Email tidak akan ditampilkan

0/2000 karakter

⚠️ Catatan: Komentar akan dimoderasi sebelum ditampilkan. Mohon bersikap sopan dan konstruktif.