fix: use jump host SOCKS proxy settings (#1116)

This commit is contained in:
ZacharyZcR
2026-07-28 02:21:21 +08:00
committed by GitHub
parent 5c709d38d6
commit 291ccf2549
9 changed files with 65 additions and 85 deletions
+2 -9
View File
@@ -1,10 +1,7 @@
import { Client as SSHClient } from "ssh2";
import { createCurrentHostResolutionRepository } from "../database/repositories/factory.js";
import { fileLogger } from "../utils/logger.js";
import {
createSocks5Connection,
type SOCKS5Config,
} from "../utils/socks5-helper.js";
import { createSocks5Connection } from "../utils/socks5-helper.js";
import { SSH_ALGORITHMS } from "../utils/ssh-algorithms.js";
import { SSHHostKeyVerifier } from "./host-key-verifier.js";
import { getJumpHostSocks5Config } from "./jump-host-proxy.js";
@@ -106,7 +103,6 @@ async function resolveJumpHost(
export async function createJumpHostChain(
jumpHosts: Array<{ hostId: number }>,
userId: string,
socks5Config?: SOCKS5Config | null,
): Promise<SSHClient | null> {
if (!jumpHosts || jumpHosts.length === 0) {
return null;
@@ -138,10 +134,7 @@ export async function createJumpHostChain(
}
}
const firstHopSocks5Config = getJumpHostSocks5Config(
jumpHostConfigs[0],
socks5Config,
);
const firstHopSocks5Config = getJumpHostSocks5Config(jumpHostConfigs[0]);
let proxySocket: import("net").Socket | null = null;
if (firstHopSocks5Config?.useSocks5) {
const firstHop = jumpHostConfigs[0]!;