diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKS4aServer.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKS4aServer.java index 58ea0ee94..546e7129d 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKS4aServer.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKS4aServer.java @@ -118,11 +118,11 @@ public class SOCKS4aServer extends SOCKSServer { } } - // Check if the requested IP should be mapped to a URL - String mappedUrl = getMappedUrlForIP(connHostName); - if (mappedUrl != null) { - _log.debug("IPV4 address " + connHostName + " was mapped to URL " + mappedUrl); - connHostName = mappedUrl; + // Check if the requested IP should be mapped to a domain name + String mappedDomainName = getMappedDomainNameForIP(connHostName); + if (mappedDomainName != null) { + _log.debug("IPV4 address " + connHostName + " was mapped to domain name " + mappedDomainName); + connHostName = mappedDomainName; } // discard user name diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKS5Server.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKS5Server.java index 840cd8966..f55a80aa7 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKS5Server.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKS5Server.java @@ -206,12 +206,12 @@ public class SOCKS5Server extends SOCKSServer { connHostName += "."; } } - // Check if the requested IP should be mapped to a URL - String mappedUrl = getMappedUrlForIP(connHostName); - if (mappedUrl != null) { - _log.debug("IPV4 address " + connHostName + " was mapped to URL " + mappedUrl); + // Check if the requested IP should be mapped to a domain name + String mappedDomainName = getMappedDomainNameForIP(connHostName); + if (mappedDomainName != null) { + _log.debug("IPV4 address " + connHostName + " was mapped to domain name " + mappedDomainName); addressType = AddressType.DOMAINNAME; - connHostName = mappedUrl; + connHostName = mappedDomainName; } else if (command != Command.UDP_ASSOCIATE) _log.warn("IPV4 address type in request: " + connHostName + ". Is your client secure?"); break; diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKSServer.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKSServer.java index 912486a7d..adde67b92 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKSServer.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKSServer.java @@ -30,14 +30,14 @@ public abstract class SOCKSServer { protected Properties props; /** - * IP to I2P URL mapping support. This matches the given IP string against - * a user-set list of mappings. This enables applications which do not - * properly support the SOCKS5 DOMAINNAME feature to be used with I2P. + * IP to domain name mapping support. This matches the given IP string + * against a user-set list of mappings. This enables applications which do + * not properly support the SOCKS5 DOMAINNAME feature to be used with I2P. * @param ip The IP address to check. - * @return The I2P URL if a mapping is found, or null otherwise. + * @return The domain name if a mapping is found, or null otherwise. * @since 0.9.5 */ - protected String getMappedUrlForIP(String ip) { + protected String getMappedDomainNameForIP(String ip) { if (props.containsKey(PROP_MAPPING_PREFIX + ip)) return props.getProperty(PROP_MAPPING_PREFIX + ip); return null; diff --git a/history.txt b/history.txt index e0167ac47..bf622bbef 100644 --- a/history.txt +++ b/history.txt @@ -1,3 +1,9 @@ +2013-02-04 str4d + * i2ptunnel: + - IP -> domain name mapping in SOCKS client tunnel: + - Change SOCKS5 addressType on a successful mapping + - Allow any domain name to be mapped, not just .i2p + 2013-01-31 kytv * Add Norwegian Bokmål language to the router console * Add Bokmål translations from Transifex