--- a/src/eric7/EricNetwork/EricJsonStreamReader.py Tue Nov 22 16:33:30 2022 +0100 +++ b/src/eric7/EricNetwork/EricJsonStreamReader.py Wed Nov 23 10:48:46 2022 +0100 @@ -47,22 +47,29 @@ # setup the network interface if ip is None: networkInterface = Preferences.getDebugger("NetworkInterface") - if networkInterface == "all" or "." in networkInterface: + if networkInterface in ("allv4", "localv4") or "." in networkInterface: # IPv4 self.__hostAddress = "127.0.0.1" - else: + elif networkInterface in ("all", "allv6", "localv6"): # IPv6 self.__hostAddress = "::1" + else: + self.__hostAddress = networkInterface else: self.__hostAddress = ip self.listen(QHostAddress(self.__hostAddress)) self.newConnection.connect(self.handleNewConnection) - ## Note: Need the port if writer is started external in debugger. + ## Note: Need the address and port if client is started external in debugger. + hostAddressStr = ( + "[{0}]".format(self.__hostAddress) + if ":" in self.__hostAddress + else self.__hostAddress + ) print( # __IGNORE_WARNING_M801__ - "JSON reader ({1}) listening on: {0:d}".format( - self.serverPort(), self.__name + "JSON server ({2}) listening on: {0}:{1:d}".format( + hostAddressStr, self.serverPort(), self.__name ) )