mirror of
https://github.com/sirjonasxx/G-Earth.git
synced 2024-11-23 08:50:52 +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;
|
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 new LinuxRawIpProxyProvider(proxySetter, stateSetter, hConnection, domain, port, socksConfig.useSocks() && !socksConfig.onlyUseIfNeeded());
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -8,8 +8,7 @@ public class IpMapperFactory {
|
|||||||
|
|
||||||
if (OSValidator.isWindows()) return new WindowsIpMapper();
|
if (OSValidator.isWindows()) return new WindowsIpMapper();
|
||||||
if (OSValidator.isUnix()) return new LinuxIpMapper();
|
if (OSValidator.isUnix()) return new LinuxIpMapper();
|
||||||
|
else return new MacIpMapper();
|
||||||
return new EmptyIpMapper();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,7 @@ package gearth.protocol.hostreplacer.ipmapping;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
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 MacIpMapper extends IpMapper {
|
||||||
public class EmptyIpMapper extends IpMapper {
|
|
||||||
@Override
|
@Override
|
||||||
public void enable() {
|
public void enable() {
|
||||||
|
|
||||||
@ -12,12 +11,12 @@ public class EmptyIpMapper extends IpMapper {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addMapping(String ip) {
|
public void addMapping(String ip) {
|
||||||
|
runCommand("ifconfig", "lo0", "alias", ip);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteMapping(String ip) {
|
public void deleteMapping(String ip) {
|
||||||
|
runCommand("ifconfig", "lo0", "-alias", ip);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
Loading…
Reference in New Issue
Block a user