I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 5a1053e4 authored by str4d's avatar str4d
Browse files

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).
parent 0052ebf3
No related branches found
No related tags found
No related merge requests found
...@@ -118,9 +118,9 @@ public class SOCKS4aServer extends SOCKSServer { ...@@ -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); 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); _log.debug("IPV4 address " + connHostName + " was mapped to URL " + mappedUrl);
connHostName = mappedUrl; connHostName = mappedUrl;
} }
......
...@@ -206,9 +206,9 @@ public class SOCKS5Server extends SOCKSServer { ...@@ -206,9 +206,9 @@ public class SOCKS5Server extends SOCKSServer {
connHostName += "."; 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); 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); _log.debug("IPV4 address " + connHostName + " was mapped to URL " + mappedUrl);
addressType = AddressType.DOMAINNAME; addressType = AddressType.DOMAINNAME;
connHostName = mappedUrl; connHostName = mappedUrl;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment