start.py 643 B

1234567891011121314151617181920
  1. import sys
  2. import BaseHTTPServer, SimpleHTTPServer
  3. from SimpleHTTPProxy import SimpleHTTPProxy
  4. SimpleHTTPProxy.set_routes({
  5. 'container_01': 'http://localhost:9999/container_01/',
  6. 'container_02': 'http://localhost:9998/container_02/',
  7. 'container_03': 'http://localhost:9997/container_03/',
  8. 'container_04': 'http://localhost:9996/container_04/'
  9. })
  10. httpd = BaseHTTPServer.HTTPServer(("", 8080), SimpleHTTPProxy)
  11. host, port = httpd.socket.getsockname()
  12. print('Listening on http://%s:%i' % (host,port))
  13. try:
  14. httpd.serve_forever()
  15. except KeyboardInterrupt:
  16. print("\nKeyboard interrupt received, exiting.")
  17. sys.exit(0)