parameters: (self, http_archive_fetch, custom_handlers, rules,
                 host='localhost', port=80, use_delays=False, is_ssl=False,
                 protocol='HTTP', allow_generate_304=False,
                 down_bandwidth='0', up_bandwidth='0', delay_ms='0')
docstring: Start HTTP server.
  
      Args:
        rules: a rule_parser Rules.
        host: a host string (name or IP) for the web proxy.
        port: a port string (e.g. '80') for the web proxy.
        use_delays: if True, add response data delays during replay.
        is_ssl: True iff proxy is using SSL.
        up_bandwidth: Upload bandwidth
        down_bandwidth: Download bandwidth
             Bandwidths measured in [K|M]{bit/s|Byte/s}. '0' means unlimited.
        delay_ms: Propagation delay in milliseconds. '0' means no delay.
docstring_summary: Start HTTP server.
docstring_tokens: Start HTTP server .
function: def __init__(self, http_archive_fetch, custom_handlers, rules,
                 host='localhost', port=80, use_delays=False, is_ssl=False,
                 protocol='HTTP', allow_generate_304=False,
                 down_bandwidth='0', up_bandwidth='0', delay_ms='0'):
      """Start HTTP server.
  
      Args:
        rules: a rule_parser Rules.
        host: a host string (name or IP) for the web proxy.
        port: a port string (e.g. '80') for the web proxy.
        use_delays: if True, add response data delays during replay.
        is_ssl: True iff proxy is using SSL.
        up_bandwidth: Upload bandwidth
        down_bandwidth: Download bandwidth
             Bandwidths measured in [K|M]{bit/s|Byte/s}. '0' means unlimited.
        delay_ms: Propagation delay in milliseconds. '0' means no delay.
      """
      if platformsettings.SupportsFdLimitControl():
        # BaseHTTPServer opens a new thread and two fds for each connection.
        # Check that the process can open at least 1000 fds.
        soft_limit, hard_limit = platformsettings.GetFdLimit()
        # Add some wiggle room since there are probably fds not associated with
        # connections.
        wiggle_room = 100
        desired_limit = 2 * HttpProxyServer.connection_limit + wiggle_room
        if soft_limit < desired_limit:
          assert desired_limit <= hard_limit, (
              'The hard limit for number of open files per process is %s which '
              'is lower than the desired limit of %s.' %
              (hard_limit, desired_limit))
          platformsettings.AdjustFdLimit(desired_limit, hard_limit)
  
      try:
        BaseHTTPServer.HTTPServer.__init__(self, (host, port), self.HANDLER)
      except Exception, e:
        raise HttpProxyServerError('Could not start HTTPServer on port %d: %s' %
                                   (port, e))
      self.http_archive_fetch = http_archive_fetch
      self.custom_handlers = custom_handlers
      self.use_delays = use_delays
      self.is_ssl = is_ssl
      self.traffic_shaping_down_bps = proxyshaper.GetBitsPerSecond(down_bandwidth)
      self.traffic_shaping_up_bps = proxyshaper.GetBitsPerSecond(up_bandwidth)
      self.traffic_shaping_delay_ms = int(delay_ms)
      self.num_active_requests = 0
      self.num_active_connections = 0
      self.total_request_time = 0
      self.protocol = protocol
      self.allow_generate_304 = allow_generate_304
      self.log_url = rules.Find('log_url')
  
      # Note: This message may be scraped. Do not change it.
      logging.warning(
          '%s server started on %s:%d' % (self.protocol, self.server_address[0],
                                          self.server_address[1]))
function_tokens: def __init__ ( self , http_archive_fetch , custom_handlers , rules , host = 'localhost' , port = 80 , use_delays = False , is_ssl = False , protocol = 'HTTP' , allow_generate_304 = False , down_bandwidth = '0' , up_bandwidth = '0' , delay_ms = '0' ) : if platformsettings . SupportsFdLimitControl ( ) : # BaseHTTPServer opens a new thread and two fds for each connection. # Check that the process can open at least 1000 fds. soft_limit , hard_limit = platformsettings . GetFdLimit ( ) # Add some wiggle room since there are probably fds not associated with # connections. wiggle_room = 100 desired_limit = 2 * HttpProxyServer . connection_limit + wiggle_room if soft_limit < desired_limit : assert desired_limit <= hard_limit , ( 'The hard limit for number of open files per process is %s which ' 'is lower than the desired limit of %s.' % ( hard_limit , desired_limit ) ) platformsettings . AdjustFdLimit ( desired_limit , hard_limit ) try : BaseHTTPServer . HTTPServer . __init__ ( self , ( host , port ) , self . HANDLER ) except Exception , e : raise HttpProxyServerError ( 'Could not start HTTPServer on port %d: %s' % ( port , e ) ) self . http_archive_fetch = http_archive_fetch self . custom_handlers = custom_handlers self . use_delays = use_delays self . is_ssl = is_ssl self . traffic_shaping_down_bps = proxyshaper . GetBitsPerSecond ( down_bandwidth ) self . traffic_shaping_up_bps = proxyshaper . GetBitsPerSecond ( up_bandwidth ) self . traffic_shaping_delay_ms = int ( delay_ms ) self . num_active_requests = 0 self . num_active_connections = 0 self . total_request_time = 0 self . protocol = protocol self . allow_generate_304 = allow_generate_304 self . log_url = rules . Find ( 'log_url' ) # Note: This message may be scraped. Do not change it. logging . warning ( '%s server started on %s:%d' % ( self . protocol , self . server_address [ 0 ] , self . server_address [ 1 ] ) )