Skip to content

Instantly share code, notes, and snippets.

Created February 15, 2018 16:16
  • Star 11 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Python SimpleHTTPServer over IPv6. Run as `python -m SimpleHTTPServer6 [PORT]`
import BaseHTTPServer
import SimpleHTTPServer
import socket
class HTTPServer6(BaseHTTPServer.HTTPServer):
address_family = socket.AF_INET6
if __name__ == '__main__':
Copy link

Menci commented Mar 17, 2019

We can simply execute in bash:

echo -e 'import BaseHTTPServer\nimport SimpleHTTPServer\nimport socket\nclass HTTPServer6(BaseHTTPServer.HTTPServer):\n address_family = socket.AF_INET6\nif __name__ == "__main__":\n SimpleHTTPServer.test(ServerClass=HTTPServer6)' | python2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment