Add local routing rules to Harbor
This commit is contained in:
@@ -21,13 +21,20 @@ const subscriptionConfig = {
|
||||
}],
|
||||
};
|
||||
|
||||
test('client exposes one local proxy and routes it through the selected VPN', () => {
|
||||
const config = buildGatewayConfig(subscriptionConfig, 'test-vpn');
|
||||
test('client exposes one local proxy and routes local exceptions before the selected VPN', () => {
|
||||
const config = buildGatewayConfig(subscriptionConfig, 'test-vpn', {
|
||||
routeRules: [
|
||||
{ type: 'domain', value: 'example.com' },
|
||||
{ type: 'domain_keyword', value: 'cdn' },
|
||||
],
|
||||
});
|
||||
|
||||
assert.deepEqual(config.inbounds.map((inbound) => inbound.tag), ['mixed-in']);
|
||||
assert.equal(config.inbounds[0].listen_port, 8082);
|
||||
assert.deepEqual(config.route.rules, [
|
||||
{ domain_suffix: ['ru'], outbound: 'direct' },
|
||||
{ domain: ['example.com'], outbound: 'direct' },
|
||||
{ domain_keyword: ['cdn'], outbound: 'direct' },
|
||||
{ inbound: ['mixed-in'], outbound: 'test-vpn' },
|
||||
]);
|
||||
assert.equal(config.route.final, 'test-vpn');
|
||||
|
||||
Reference in New Issue
Block a user