You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/test/integration/targets/ansible-galaxy/files/testserver.py

21 lines
675 B
Python

from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import sys
import ssl
if __name__ == '__main__':
if sys.version_info[0] >= 3:
import http.server
import socketserver
Handler = http.server.SimpleHTTPRequestHandler
httpd = socketserver.TCPServer(("", 4443), Handler)
else:
import BaseHTTPServer
import SimpleHTTPServer
Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
httpd = BaseHTTPServer.HTTPServer(("", 4443), Handler)
httpd.socket = ssl.wrap_socket(httpd.socket, certfile='./cert.pem', keyfile='./key.pem', server_side=True)
httpd.serve_forever()