forked from I2P_Developers/i2p.i2p
Allow any domain name to be mapped to an IP
This enables .onion domain names to be accessed by clients that are being routed through the SOCKS tunnel by e.g. proxychains (assuming that the SOCKS tunnel has been configured with a SOCKS outproxy that exits into Tor). If the .onion is not mapped to an IP address, the client would attempt a DNS lookup which would of course fail to find the .onion. Clearnet domain names can also be mapped to IPs, but this is irrelevant as DNS lookups work through SOCKS (via the configured outproxy).
This commit is contained in:
@@ -118,9 +118,9 @@ public class SOCKS4aServer extends SOCKSServer {
|
||||
}
|
||||
}
|
||||
|
||||
// Check if the requested IP should be mapped to a .i2p URL
|
||||
// Check if the requested IP should be mapped to a URL
|
||||
String mappedUrl = getMappedUrlForIP(connHostName);
|
||||
if (mappedUrl != null && mappedUrl.toLowerCase(Locale.US).endsWith(".i2p")) {
|
||||
if (mappedUrl != null) {
|
||||
_log.debug("IPV4 address " + connHostName + " was mapped to URL " + mappedUrl);
|
||||
connHostName = mappedUrl;
|
||||
}
|
||||
|
@@ -206,9 +206,9 @@ public class SOCKS5Server extends SOCKSServer {
|
||||
connHostName += ".";
|
||||
}
|
||||
}
|
||||
// Check if the requested IP should be mapped to a .i2p URL
|
||||
// Check if the requested IP should be mapped to a URL
|
||||
String mappedUrl = getMappedUrlForIP(connHostName);
|
||||
if (mappedUrl != null && mappedUrl.toLowerCase(Locale.US).endsWith(".i2p")) {
|
||||
if (mappedUrl != null) {
|
||||
_log.debug("IPV4 address " + connHostName + " was mapped to URL " + mappedUrl);
|
||||
addressType = AddressType.DOMAINNAME;
|
||||
connHostName = mappedUrl;
|
||||
|
Reference in New Issue
Block a user