25 lines
628 B
JavaScript
25 lines
628 B
JavaScript
import assert from "node:assert/strict";
|
|
import test from "node:test";
|
|
|
|
const {
|
|
buildSharedProxyInfo,
|
|
} = await import("../../src/server/sharedProxy.js");
|
|
|
|
test("gateway shared proxy info exposes host and socks proxy when running", () => {
|
|
const info = buildSharedProxyInfo({
|
|
appMode: "gateway",
|
|
proxyPort: 8080,
|
|
running: true,
|
|
hostHeader: "192.168.50.111:3456",
|
|
});
|
|
|
|
assert.equal(info.available, true);
|
|
assert.deepEqual(info.proxy, {
|
|
host: "192.168.50.111",
|
|
port: 8080,
|
|
protocol: "socks5",
|
|
httpUrl: "http://192.168.50.111:8080",
|
|
socksUrl: "socks5://192.168.50.111:8080",
|
|
});
|
|
});
|