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

Changeset 1767

Show
Ignore:
Timestamp:
10/26/07 02:33:28
Author:
fumanchu
Message:

Fix for #740 (Default server.socket_host to IPv4 address).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/__init__.py

    r1757 r1767  
    264264    __metaclass__ = _AttributeDocstrings 
    265265     
    266     request = _cprequest.Request(_http.Host("localhost", 80), 
    267                                  _http.Host("localhost", 1111)) 
     266    request = _cprequest.Request(_http.Host("127.0.0.1", 80), 
     267                                 _http.Host("127.0.0.1", 1111)) 
    268268    request__doc = """ 
    269269    The request object for the current thread. In the main thread, 
  • trunk/cherrypy/_cpmodpy.py

    r1690 r1767  
    6262resides in the global site-package this won't be needed. 
    6363 
    64 Then restart apache2 and access http://localhost:8080 
     64Then restart apache2 and access http://127.0.0.1:8080 
    6565""" 
    6666 
  • trunk/cherrypy/_cprequest.py

    r1765 r1767  
    168168     
    169169    # Conversation/connection attributes 
    170     local = http.Host("localhost", 80) 
     170    local = http.Host("127.0.0.1", 80) 
    171171    local__doc = \ 
    172172        "An http.Host(ip, port, hostname) object for the server socket." 
    173173     
    174     remote = http.Host("localhost", 1111) 
     174    remote = http.Host("127.0.0.1", 1111) 
    175175    remote__doc = \ 
    176176        "An http.Host(ip, port, hostname) object for the client socket." 
  • trunk/cherrypy/_cpserver.py

    r1752 r1767  
    3535     
    3636        s1 = MyWSGIServer(host='0.0.0.0', port=80) 
    37         s2 = another.HTTPServer(host='localhost', SSL=True) 
     37        s2 = another.HTTPServer(host='127.0.0.1', SSL=True) 
    3838        cherrypy.server.httpservers = {s1: ('0.0.0.0', 80), 
    39                                        s2: ('localhost', 443)} 
     39                                       s2: ('127.0.0.1', 443)} 
    4040        # Note we do not use quickstart when we define our own httpservers 
    4141        cherrypy.server.start() 
     
    4848    socket_port = 8080 
    4949     
    50     _socket_host = 'localhost
     50    _socket_host = '127.0.0.1
    5151    def _get_socket_host(self): 
    5252        return self._socket_host 
  • trunk/cherrypy/lib/cptools.py

    r1614 r1767  
    124124        port = cherrypy.request.local.port 
    125125        if port == 80: 
    126             base = 'localhost
     126            base = '127.0.0.1
    127127        else: 
    128             base = 'localhost:%s' % port 
     128            base = '127.0.0.1:%s' % port 
    129129     
    130130    if base.find("://") == -1: 
  • trunk/cherrypy/restsrv/servers.py

    r1752 r1767  
    1919     
    2020        s1 = MyWSGIServer(host='0.0.0.0', port=80) 
    21         s2 = another.HTTPServer(host='localhost', SSL=True) 
     21        s2 = another.HTTPServer(host='127.0.0.1', SSL=True) 
    2222        server.httpservers = {s1: ('0.0.0.0', 80), 
    23                               s2: ('localhost', 443)} 
     23                              s2: ('127.0.0.1', 443)} 
    2424        server.start() 
    2525     
  • trunk/cherrypy/test/test_http.py

    r1727 r1767  
    3232        # will hang. Verify that CP times out the socket and responds 
    3333        # with 411 Length Required. 
    34         c = httplib.HTTPConnection("localhost:%s" % self.PORT) 
     34        c = httplib.HTTPConnection("127.0.0.1:%s" % self.PORT) 
    3535        c.request("POST", "/") 
    3636        self.assertEqual(c.getresponse().status, 411) 
  • trunk/cherrypy/test/test_objectmapping.py

    r1764 r1767  
    243243         
    244244        # Test absoluteURI's in the Request-Line 
    245         self.getPage('http://localhost/') 
     245        self.getPage('http://127.0.0.1/') 
    246246        self.assertBody('world') 
    247247         
  • trunk/cherrypy/tutorial/tutorial.conf

    r1598 r1767  
    11[global] 
    2 server.socket_host = "localhost
     2server.socket_host = "127.0.0.1
    33server.socket_port = 8080 
    44server.thread_pool = 10 
  • trunk/cherrypy/wsgiserver/__init__.py

    r1766 r1767  
    1313     
    1414    server = wsgiserver.CherryPyWSGIServer( 
    15                 ('localhost', 8070), my_crazy_app, 
    16                 server_name='localhost') 
     15                ('0.0.0.0', 8070), my_crazy_app, 
     16                server_name='www.cherrypy.example') 
    1717     
    1818The CherryPy WSGI server can serve as many WSGI applications  
     
    868868     
    869869    protocol = "HTTP/1.1" 
    870     _bind_addr = "localhost
     870    _bind_addr = "127.0.0.1
    871871    version = "CherryPy/3.1alpha" 
    872872    ready = False 

Hosted by WebFaction

Log in as guest/cpguest to create tickets