mirror of
https://github.com/sbrl/bin.git
synced 2018-01-10 21:33:46 +00:00
24 lines
495 B
Text
24 lines
495 B
Text
|
#! /usr/bin/env python
|
||
|
import SimpleHTTPServer
|
||
|
import SocketServer
|
||
|
import socket
|
||
|
import sys
|
||
|
|
||
|
|
||
|
try:
|
||
|
PORT=int(raw_input('Enter Port Number or Simply press Enter/Return :'))
|
||
|
except ValueError:
|
||
|
PORT = 8000
|
||
|
|
||
|
Host = socket.gethostbyname(socket.gethostname())
|
||
|
|
||
|
Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
|
||
|
|
||
|
httpd = SocketServer.TCPServer(("", PORT), Handler)
|
||
|
|
||
|
print "\n Your folder is Quickshared on : ", Host+":"+str(PORT)
|
||
|
print "\n Use Ctrl+C to stop sharing"
|
||
|
httpd.serve_forever()
|
||
|
|
||
|
|