mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-09-30 04:15:52 +00:00
Fix proxy handling for local cli socket
This commit is contained in:
@@ -46,6 +46,7 @@ public class BeaconClient {
|
||||
}
|
||||
|
||||
var client = HttpClient.newBuilder()
|
||||
.proxy(HttpClient.Builder.NO_PROXY)
|
||||
.followRedirects(HttpClient.Redirect.NORMAL)
|
||||
.build();
|
||||
HttpResponse<String> response;
|
||||
|
||||
@@ -2,12 +2,10 @@ package io.xpipe.app.beacon;
|
||||
|
||||
import io.xpipe.app.beacon.api.DaemonStopExchange;
|
||||
|
||||
import io.xpipe.app.core.AppProperties;
|
||||
import lombok.SneakyThrows;
|
||||
|
||||
import java.net.Inet4Address;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.ServerSocket;
|
||||
import java.net.Socket;
|
||||
import java.net.*;
|
||||
|
||||
public class BeaconServer {
|
||||
|
||||
@@ -15,7 +13,7 @@ public class BeaconServer {
|
||||
public static boolean isReachable(int port) {
|
||||
var local = Inet4Address.getByAddress(new byte[] {0x7f, 0x00, 0x00, 0x01});
|
||||
|
||||
try (var socket = new Socket()) {
|
||||
try (var socket = new Socket(Proxy.NO_PROXY)) {
|
||||
InetSocketAddress adress = new InetSocketAddress(local, port);
|
||||
socket.connect(adress, 5000);
|
||||
} catch (Exception e) {
|
||||
|
||||
+10
-11
@@ -153,6 +153,16 @@ def getBaseJvmArgs() {
|
||||
// Reduce heap usage with deduplication
|
||||
jvmRunArgs += ['-XX:+UseStringDeduplication']
|
||||
|
||||
return jvmRunArgs
|
||||
}
|
||||
|
||||
def getDaemonJvmArgs() {
|
||||
def os = DefaultNativePlatform.currentOperatingSystem
|
||||
def jvmRunArgs = ["-Dio.xpipe.app.isDaemon=true"]
|
||||
|
||||
// Use custom JavaFX preloader
|
||||
jvmRunArgs += ["-Djavafx.preloader=" + packageName("core.AppPreloader")]
|
||||
|
||||
// Why is this not on by default? ...
|
||||
// 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
|
||||
@@ -164,17 +174,6 @@ def getBaseJvmArgs() {
|
||||
'-Djdk.httpclient.auth.retrylimit=1'
|
||||
]
|
||||
|
||||
|
||||
return jvmRunArgs
|
||||
}
|
||||
|
||||
def getDaemonJvmArgs() {
|
||||
def os = DefaultNativePlatform.currentOperatingSystem
|
||||
def jvmRunArgs = ["-Dio.xpipe.app.isDaemon=true"]
|
||||
|
||||
// Use custom JavaFX preloader
|
||||
jvmRunArgs += ["-Djavafx.preloader=" + packageName("core.AppPreloader")]
|
||||
|
||||
// Disable JDK24 warnings
|
||||
jvmRunArgs += [
|
||||
"--enable-native-access=com.sun.jna",
|
||||
|
||||
Reference in New Issue
Block a user