A quick way to serve a directory! Kadang2 lupo, simpan sini nota:
python 2 :
python 3:
webx tue nama folder utk jd root folder bg web
8080 port tue bleh ubah ikut keadaan.
Lepas nie bleh laa run laptop dkt umh korang, then sedut dr opis. ipv6 kene ado laa dan firewall rules allow :D :D
Nk buka ipv6 ip dkt web browser mcm nie:
http://[ip:v6:sini:tau]:8080
or pakai je https://dynv6.com/ setel..xyah nk ingat2 no. pelik tue semua..hahah
python 2 :
python -m SimpleHTTPServer <port>
python 3:
python -m http.server <port>
Or guna simple script nie utk ipv6:from http.server import HTTPServer
from http.server import SimpleHTTPRequestHandler
import socket
import os
web_dir = os.path.join(os.path.dirname(__file__), 'webx')
os.chdir(web_dir)
class HTTPServerV6(HTTPServer):
address_family = socket.AF_INET6
server = HTTPServerV6(('::', 8080), SimpleHTTPRequestHandler)
server.serve_forever()
webx tue nama folder utk jd root folder bg web
8080 port tue bleh ubah ikut keadaan.
Lepas nie bleh laa run laptop dkt umh korang, then sedut dr opis. ipv6 kene ado laa dan firewall rules allow :D :D
Nk buka ipv6 ip dkt web browser mcm nie:
http://[ip:v6:sini:tau]:8080
or pakai je https://dynv6.com/ setel..xyah nk ingat2 no. pelik tue semua..hahah
No comments:
Post a Comment