Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Ticket #643 (defect)

Opened 2 years ago

Last modified 1 year ago

server.socket_host is confusing

Status: closed (fixed)

Reported by: fumanchu Assigned to: fumanchu
Priority: normal Milestone: 3.0
Component: CherryPy code Keywords:
Cc:

cherrypy.server.socket_host defaults to '' (the empty string), and it probably shouldn't.

First, it should default to 'localhost', because all object defaults in CherryPy 3 should reflect the "development" environment (what you get if you do not specify an environment in config). Most people, while developing, are going to want to listen on and connect from localhost.

Second, the whole concept of '' or None as a valid value for server.socket_host should be explicitly disallowed:

  1. Different people have different expectations about what '' and None are shorthand for.
  2. There are already more-explicit values available for everything you might expect None or '' to be shorthand for.
  3. The transformations from the shorthand to the more-explicit value are distributed throughout the code and hard to understand.

The following values should be valid:

  • Any IPv4 or IPv6 address
  • Any valid hostname
  • 'localhost' as a synonym for '127.0.0.1'
  • '0.0.0.0' as a special entry meaning "all active interfaces".

Change History

01/13/07 12:23:32: Modified by fumanchu

If nothing else, we could put a note in cherrypy.checker for a socket_host which is blank or None.

06/16/07 16:25:44: Modified by fumanchu

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in [1665].

Hosted by WebFaction

Log in as guest/cpguest to create tickets