From 358cbec9f9918ce0f2ef5132c88b419e8b716084 Mon Sep 17 00:00:00 2001 From: Gahow Wang Date: Mon, 28 Sep 2026 22:14:47 +0800 Subject: [PATCH] Pass the Gateway proxy through JDK_JAVA_OPTIONS, which IBC keeps IBC clears JAVA_TOOL_OPTIONS before launching java. Also point the service's http(s)/all proxy variables at 7892 instead of the user manager's 7890. Co-Authored-By: Claude Opus 5.5 --- deploy/systemd/ibgateway.service | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/deploy/systemd/ibgateway.service b/deploy/systemd/ibgateway.service index e43aec8..ecb0396 100644 --- a/deploy/systemd/ibgateway.service +++ b/deploy/systemd/ibgateway.service @@ -4,9 +4,12 @@ After=network-online.target [Service] Type=simple -# Reach IBKR through pc's "ipads" proxy (mihomo, SOCKS5 on 7892). IBC drops -D -# lines from ibgateway.vmoptions, so the JVM gets them from the environment. -Environment="JAVA_TOOL_OPTIONS=-DsocksProxyHost=127.0.0.1 -DsocksProxyPort=7892" +# Reach IBKR through pc's "ipads" proxy (mihomo, SOCKS5/HTTP on 7892), as +# `proxy ipads` does in a shell. IBC drops -D lines from ibgateway.vmoptions and +# clears JAVA_TOOL_OPTIONS, so the java launcher gets them via JDK_JAVA_OPTIONS. +Environment="JDK_JAVA_OPTIONS=-DsocksProxyHost=127.0.0.1 -DsocksProxyPort=7892" +Environment=http_proxy=http://127.0.0.1:7892 https_proxy=http://127.0.0.1:7892 all_proxy=http://127.0.0.1:7892 +Environment=HTTP_PROXY=http://127.0.0.1:7892 HTTPS_PROXY=http://127.0.0.1:7892 ALL_PROXY=http://127.0.0.1:7892 ExecStart=/usr/bin/xvfb-run -a -s "-screen 0 1024x768x24" %h/ibc/gatewaystart.sh -inline Restart=always RestartSec=60