attempt for mac raw ip support

This commit is contained in:
sirjonasxx 2020-06-03 16:24:00 +02:00
parent 059ee913c1
commit e3c8998773
3 changed files with 5 additions and 7 deletions

View File

@ -111,7 +111,7 @@ public class ProxyProviderFactory {
return null;
}
else if (OSValidator.isUnix()) {
else if (OSValidator.isUnix() || OSValidator.isMac()) {
return new LinuxRawIpProxyProvider(proxySetter, stateSetter, hConnection, domain, port, socksConfig.useSocks() && !socksConfig.onlyUseIfNeeded());
}
return null;

View File

@ -8,8 +8,7 @@ public class IpMapperFactory {
if (OSValidator.isWindows()) return new WindowsIpMapper();
if (OSValidator.isUnix()) return new LinuxIpMapper();
return new EmptyIpMapper();
else return new MacIpMapper();
}
}

View File

@ -3,8 +3,7 @@ package gearth.protocol.hostreplacer.ipmapping;
import java.util.ArrayList;
import java.util.List;
// Temporary class for the sake of not getting nullpointers on linux&mac until they have an IpMapper as well
public class EmptyIpMapper extends IpMapper {
public class MacIpMapper extends IpMapper {
@Override
public void enable() {
@ -12,12 +11,12 @@ public class EmptyIpMapper extends IpMapper {
@Override
public void addMapping(String ip) {
runCommand("ifconfig", "lo0", "alias", ip);
}
@Override
public void deleteMapping(String ip) {
runCommand("ifconfig", "lo0", "-alias", ip);
}
@Override