mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-10-25 00:01:02 +00:00
Rework
This commit is contained in:
3 files changed
+20
-22
No files matched your search
@@ -140,25 +140,7 @@ public class HttpProxyCategory extends AppPrefsCategory {
|
||||
DataStore.class,
|
||||
r -> HttpProxy.canUseAsProxy(r.asNeeded()),
|
||||
StoreViewState.get().getAllConnectionsCategory(),
|
||||
null) {
|
||||
@Override
|
||||
protected String toName(DataStoreEntry entry) {
|
||||
if (entry == null) {
|
||||
return AppI18n.get("systemDefault");
|
||||
}
|
||||
|
||||
return super.toName(entry);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String toGraphic(DataStoreEntry entry) {
|
||||
if (entry == null) {
|
||||
return "proc:networkProxy_icon.svg";
|
||||
}
|
||||
|
||||
return super.toGraphic(entry);
|
||||
}
|
||||
};
|
||||
null);
|
||||
return comp.build();
|
||||
}),
|
||||
() -> StoreViewState.get() != null && StoreViewState.get().isInitialized());
|
||||
|
||||
@@ -46,6 +46,21 @@ public class HttpProxy {
|
||||
}
|
||||
}
|
||||
|
||||
if (OsType.ofLocal() == OsType.WINDOWS) {
|
||||
var enabled = WindowsRegistry.local().readIntegerValueIfPresent(WindowsRegistry.HKEY_CURRENT_USER,
|
||||
"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", "ProxyEnable");
|
||||
if (enabled.orElse(0) != 0) {
|
||||
var server = WindowsRegistry.local().readStringValueIfPresent(WindowsRegistry.HKEY_CURRENT_USER,
|
||||
"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", "ProxyServer");
|
||||
if (server.isPresent()) {
|
||||
var split = server.get().split(":");
|
||||
var addr = split[0];
|
||||
var port = split.length > 1 ? Integer.parseInt(split[1]) : 8080;
|
||||
return Optional.of(new HttpProxy(addr, port, null, null, false));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
|
||||
+4
-3
@@ -134,7 +134,8 @@ def getBaseJvmArgs() {
|
||||
// JavaFX performance adjustments
|
||||
jvmRunArgs += [
|
||||
"-Dprism.scrollcacheopt=true",
|
||||
"-Dprism.cacheshapes=true"
|
||||
"-Dprism.cacheshapes=true",
|
||||
"-Dprism.dirtyregioncount=15",
|
||||
]
|
||||
|
||||
|
||||
@@ -144,6 +145,7 @@ def getBaseJvmArgs() {
|
||||
"--add-opens", "java.base/java.lang=$appPackage",
|
||||
"--add-opens", "java.base/java.net=$appPackage",
|
||||
"--add-opens", "java.base/java.nio.file=$appPackage",
|
||||
"--add-opens", "java.base/java.util.regex=$appPackage",
|
||||
"--add-opens", "java.base/java.io=$appPackage",
|
||||
"--add-opens", "jdk.zipfs/jdk.nio.zipfs=io.xpipe.modulefs",
|
||||
]
|
||||
@@ -164,12 +166,11 @@ def getDaemonJvmArgs() {
|
||||
// Use custom JavaFX preloader
|
||||
jvmRunArgs += ["-Djavafx.preloader=" + packageName("core.AppPreloader")]
|
||||
|
||||
// Why is this not on by default? ...
|
||||
// Http configuration
|
||||
// https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/net/doc-files/net-properties.html
|
||||
// https://stackoverflow.com/questions/53333556/proxy-authentication-with-jdk-11-httpclient
|
||||
// https://stackoverflow.com/questions/75150081/ioexception-too-many-authentication-attempts-limit-3-when-using-jdk-httpcli
|
||||
jvmRunArgs += [
|
||||
'-Djava.net.useSystemProxies=true',
|
||||
'-Djdk.http.auth.proxying.disabledSchemes=""',
|
||||
'-Djdk.http.auth.tunneling.disabledSchemes=""',
|
||||
'-Djdk.httpclient.auth.retrylimit=1'
|
||||
|
||||
Reference in new issue
Block a user