mirror of
				https://github.com/jlu5/PyLink.git
				synced 2025-11-04 00:47:21 +01:00 
			
		
		
		
	IRCNetwork: also detect address types from supplied bindhosts
This commit is contained in:
		
							parent
							
								
									26361c4cc9
								
							
						
					
					
						commit
						5e1cb232b0
					
				@ -1675,6 +1675,11 @@ class IRCNetwork(PyLinkNetworkCoreWithUtils):
 | 
			
		||||
        try:
 | 
			
		||||
            # Set the socket type (IPv6 or IPv4), auto detecting it if not specified.
 | 
			
		||||
            isipv6 = self.serverdata.get("ipv6", utils.get_hostname_type(ip) == 2)
 | 
			
		||||
 | 
			
		||||
            if (not isipv6) and 'bindhost' in self.serverdata:
 | 
			
		||||
                # Also try detecting the socket type from the bindhost if specified.
 | 
			
		||||
                isipv6 = utils.get_hostname_type(self.serverdata['bindhost']) == 2
 | 
			
		||||
 | 
			
		||||
            stype = socket.AF_INET6 if isipv6 else socket.AF_INET
 | 
			
		||||
 | 
			
		||||
            # Creat the socket.
 | 
			
		||||
 | 
			
		||||
@ -294,9 +294,11 @@ servers:
 | 
			
		||||
        ip: somenet.ddns.local
 | 
			
		||||
        port: 45454
 | 
			
		||||
 | 
			
		||||
        # When the IP field is set to a hostname, this option determines whether IPv4 or IPv6 should
 | 
			
		||||
        # be used for the connection.
 | 
			
		||||
        # When the IP field is set to a hostname, the "ipv6" option determines whether IPv4 or IPv6
 | 
			
		||||
        # addresses should be used when resolving it. You can leave this field blank and use an
 | 
			
		||||
        # explicit bindhost instead, which will let the the address type be automatically detected.
 | 
			
		||||
        #ipv6: false
 | 
			
		||||
        #bindhost: 1111:2222:3333:4444
 | 
			
		||||
 | 
			
		||||
        # Note: if you are actually using dynamic DNS for an IRC link, consider enabling
 | 
			
		||||
        # TLS/SSL certificate checking (new in 2.0). These checks are disabled by default for
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user