def base(self):
        """Return the base for this server.

        e.i. scheme://host[:port] or sock file
        """
        if self.socket_file:
            return self.socket_file

        host = self.socket_host
        if host in ('0.0.0.0', '::'):
            # 0.0.0.0 is INADDR_ANY and :: is IN6ADDR_ANY.
            # Look up the host name, which should be the
            # safest thing to spit out in a URL.
            import socket

            host = socket.gethostname()

        port = self.socket_port

        if self.ssl_certificate:
            scheme = 'https'
            if port != 443:
                host += ':%s' % port
        else:
            scheme = 'http'
            if port != 80:
                host += ':%s' % port

        return '%s://%s' % (scheme, host)
Return the base for this server.

        e.i. scheme://host[:port] or sock file
        
cherrypy/_cpserver.py