added transparent proxying of port 443 via Tor TransPort and modifed browse check to https://check.torproject.org

svn:r21604
This commit is contained in:
Nathan Freitas 2010-02-10 06:54:13 +00:00
parent 7c4953eefc
commit 6e6dc3e20e
2 changed files with 5 additions and 3 deletions

View File

@ -10,7 +10,7 @@ public interface TorConstants {
public final static int FILE_WRITE_BUFFER_SIZE = 2048; public final static int FILE_WRITE_BUFFER_SIZE = 2048;
//path to check Tor against //path to check Tor against
public final static String URL_TOR_CHECK = "http://check.torproject.org"; public final static String URL_TOR_CHECK = "https://check.torproject.org";
public final static int STATUS_UNAVAILABLE = -1; public final static int STATUS_UNAVAILABLE = -1;
public final static int STATUS_REQUIRES_DEMAND = 0; public final static int STATUS_REQUIRES_DEMAND = 0;
@ -25,7 +25,7 @@ public interface TorConstants {
public final static String TORRC_DEFAULT = public final static String TORRC_DEFAULT =
"SocksPort 9050\nSocksListenAddress 127.0.0.1\nSafeSocks 1\nDNSPort 5400\nLog notice stdout\nLog debug syslog\nDataDirectory /data/data/org.torproject.android/data\n" "SocksPort 9050\nSocksListenAddress 127.0.0.1\nSafeSocks 1\nDNSPort 5400\nLog notice stdout\nLog debug syslog\nDataDirectory /data/data/org.torproject.android/data\n"
+ "ControlPort 9051\nCookieAuthentication 1\nRelayBandwidthRate 20 KBytes\nRelayBandwidthBurst 20 KBytes\n"; + "ControlPort 9051\nCookieAuthentication 1\nRelayBandwidthRate 20 KBytes\nRelayBandwidthBurst 20 KBytes\nAutomapHostsOnResolve 1\nTransPort 9040\n";
public final static String INTENT_TOR_SERVICE = "org.torproject.android.service.TOR_SERVICE"; public final static String INTENT_TOR_SERVICE = "org.torproject.android.service.TOR_SERVICE";

View File

@ -19,6 +19,8 @@ public final class TorRoot {
private final static String CMD_NAT_FLUSH = "iptables -t nat -F || exit\n"; private final static String CMD_NAT_FLUSH = "iptables -t nat -F || exit\n";
private final static String CMD_NAT_IPTABLES_80 = "iptables -t nat -A OUTPUT -p tcp --dport 80 -j DNAT --to 127.0.0.1:8118 || exit\n"; private final static String CMD_NAT_IPTABLES_80 = "iptables -t nat -A OUTPUT -p tcp --dport 80 -j DNAT --to 127.0.0.1:8118 || exit\n";
private final static String CMD_NAT_IPTABLES_443 = "iptables -t nat -A OUTPUT -p tcp --dport 443 -j DNAT --to 127.0.0.1:9040 || exit\n";
private final static String CMD_DNS_PROXYING = "iptables -t nat -A PREROUTING -p udp --dport 53 -j DNAT --to 127.0.0.1:5400 || exit\n"; private final static String CMD_DNS_PROXYING = "iptables -t nat -A PREROUTING -p udp --dport 53 -j DNAT --to 127.0.0.1:5400 || exit\n";
public static boolean enableDNSProxying () public static boolean enableDNSProxying ()
@ -61,7 +63,7 @@ public final class TorRoot {
int code; int code;
script.append(CMD_NAT_IPTABLES_80); script.append(CMD_NAT_IPTABLES_80);
script.append(CMD_NAT_IPTABLES_443);
/* /*
int uid = android.os.Process.getUidForName("dhcp"); int uid = android.os.Process.getUidForName("dhcp");
if (uid != -1) script.append("iptables -A OUTPUT " + itfFilter + " -m owner --uid-owner " + uid + " -j ACCEPT || exit\n"); if (uid != -1) script.append("iptables -A OUTPUT " + itfFilter + " -m owner --uid-owner " + uid + " -j ACCEPT || exit\n");