Skip to content

Instantly share code, notes, and snippets.

@grigory51
Forked from akorobov/ipv6-httpd.py
Last active April 27, 2022 09:23
Show Gist options
  • Save grigory51/b48dcf3c582c1fbc4bfa56fcd4acd0e6 to your computer and use it in GitHub Desktop.
Save grigory51/b48dcf3c582c1fbc4bfa56fcd4acd0e6 to your computer and use it in GitHub Desktop.
quick ipv6 http server using python's SimpleHttpServer
import socket
from BaseHTTPServer import HTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
class HTTPServerV6(HTTPServer):
address_family = socket.AF_INET6
def main():
server = HTTPServerV6(('::', 8081), SimpleHTTPRequestHandler)
server.serve_forever()
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment