def create_http_server(host=None, port=0):
 try:
  http = HTTPServer()
  http.bind(host=host, port=port)
 except OSError as err:
  console.exit('Failed to create HTTP server: {0}', err)
 return http

def create_http_server ( host = None , port = 0 ) : try : http = HTTPServer ( ) http . bind ( host = host , port = port ) except OSError as err : console . exit ( 'Failed to create HTTP server: {0}' , err ) return http
creates a http server listening on a given host and port .