def _test_burp_server_address(self, addr, retry=False):
        family = Burp._get_inet_family(addr)
        try:
            sock = socket.socket(family, socket.SOCK_STREAM)
            sock.connect((addr, self.port))
            sock.close()
            return True
        except socket.error:
            self._logger('warning', 'Cannot contact burp server at %s:%s', addr, self.port)
            if not retry:
                new_addr = ''
                if self.host == '127.0.0.1':
                    new_addr = '::1'
                else:
                    new_addr = '127.0.0.1'
                self._logger('info', 'Trying %s:%s instead', new_addr, self.port)
                if self._test_burp_server_address(new_addr, True):
                    self._logger('info', '%s:%s is reachable, switching to it for this runtime', new_addr, self.port)
                    self.host = new_addr
                    self.family = Burp._get_inet_family(new_addr)
                    return True
                self._logger('error', 'Cannot guess burp server address')
        return False
The :func:`burpui.misc.backend.burp1.Burp._test_burp_server_address`
dataset/ETHPy150Open ziirish/burp-ui/burpui/misc/backend/burp1.py/Burp._test_burp_server_address