Skip to content

Instantly share code, notes, and snippets.

Embed
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__':
SimpleHTTPServer.test(ServerClass=HTTPServer6)
@Menci

This comment has been minimized.

Copy link

@Menci 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
You can’t perform that action at this time.