mirror of
https://github.com/sirjonasxx/G-Earth.git
synced 2024-11-27 02:40:51 +01:00
attempt for mac raw ip support
This commit is contained in:
parent
059ee913c1
commit
e3c8998773
@ -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;
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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
|
Loading…
Reference in New Issue
Block a user