Skip to content

Commit

Permalink
Python source
Browse files Browse the repository at this point in the history
  • Loading branch information
Mehran-Seifalinia committed May 8, 2021
1 parent d55f2af commit a6d872f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Linux/ShareYourFolder.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from os import chdir, getcwd
from http.server import HTTPServer, CGIHTTPRequestHandler

def shareIt():
port = int(input(f"[!] You Are sharing \"{current_directory}\" on your local network.\nEnter Your port here: "))
chdir(".")
server = HTTPServer(("", port), CGIHTTPRequestHandler)
print(f"Server is online on 127.0.0.1:{port}")
server.serve_forever()

current_directory = getcwd()
shareIt()

0 comments on commit a6d872f

Please sign in to comment.