Click and go
- About
- Security Risks
- Running using python
- Steps to download exe
- Using exe if python is not installed
- Accessing on local network
- Finding Hosted Device's physical address
- Making it publicly available
- Bonus
- Credits
This is a simple Web Server to view/share your file on your local network. You can potentially use this to open a file/folder on your other device without worrying about sending/downloading on the device.
Using this you can save time and all the hassle of sharing is gone.
Don't Run this on a public wifi ie:(starbucks,airport wifi etc..), as other can visit and view the content.
If you want to access only on you hosted device for some reason then remove
host=0.0.0.0,
If your running on your personal wifi and only trusted users are connected to your wifi , then no worries . Hakuna Matata
- Git clone the repo or Download the zip
git clone https://github.com/DHRUV-CODER/Web-Server.git
cd .\Web-Server
pip3 install flask
python3 .\server.py
pip install flask
py .\server.py
After Running the server.py
Website will be available on : localhost
Use of m_server.py?
m_server.py is a single version of the server.py , with the code minimized . m_server.py doesn't require the templates folder . So if you want it clean and the work to be done with single file , use m_server.py and feel free to delete the rest of the files & folder
NOTE: To run the exe on LINUX , give the exe file the permission to run. else it wont run , Can't get it to work CLICK ME FOR A TUTORIAL
Download the latest exe from Here
Then put in the Directory that you want to share.
Example : Desktop
Open the exe and wait till it is Hosted on port 5000
Click allow if you want to use it on other device
After that , open your preferred Browser and go to 127.0.0.1:5000 or localhost:5000 , Only visitable on hosted device
There you can see all the files and folders
You can click on respective folders and view the content
We also support syntax highlighting which makes the content inside more readable, syntax highlighting is available for almost every type of file extension
Well these were some of the features .
Click allow
Note: For you the url might be different And that is your url , now you can use this url to visit on other device
Well it is pretty simple , Find you hosted device's physical address and put
:5000
behind it .
For Eg:
You can open
cmd
orpowershell
upto you, and typeipconfig
there you can find your hosted device's physical address.
In my case it is
192.168.100.3
, so to visit the webserver put port:5000
behind it . Final uri192.168.100.3:5000
One way can be port forwarding and stuff . Which is pretty boring and complex.
Instead i suggest you to use a tool like ngrok
What is the use Ngrok?
ngrok allows you to expose a web server running on your local machine to the internet. Just tell ngrok what port your web server is listening on.
After Downloading , open the folder which it is in using your preferred terminal.
In my case i pasted it in Desktop
Then type this command to run ngrok on port 5000
This will expose the port
5000
to the internet
and hit Enter
Command:
./ngrok http 5000
Copy the url provided by ngrok , now you can share / view it publicly.
Note: As i am using the free version it , this stay online for temporary time period only. I mean 5-6 hrs enough ig , You can always rerun it for new url .
To close it , simply press
ctrl+c
There is a inbuilt cli command avail with python , which will provide you with web server, it is bit uglier and not that useful for sharing purposes.
Command :
python3 -m http.server 5000
You just need python for this.
Well that it for the steps . If you find any typos , feel free to send a pull request.
Hope it helps you.