Skip to content

Commit

Permalink
chore: add two common options for clash.meta nodeConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoupers committed Nov 20, 2024
1 parent 401f4ef commit f8da0f3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/utils/clash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ export const getClashNodes = function (
if (nodeConfig.underlyingProxy) {
clashNode['dialer-proxy'] = nodeConfig.underlyingProxy
}
if (nodeConfig.ipVersion) {
clashNode['ip-version'] = nodeConfig.ipVersion
}
if (nodeConfig.interfaceName) {
clashNode['interface-name'] = nodeConfig.interfaceName
}

if ('multiplex' in nodeConfig && nodeConfig.multiplex) {
// https://wiki.metacubex.one/config/proxies/sing-mux/#sing-mux
Expand Down
2 changes: 2 additions & 0 deletions src/validators/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ export const SimpleNodeConfigValidator = z.object({
hostnameIp: z.array(z.string()).readonly().optional(),
binPath: z.string().optional(),
localPort: z.number().optional(),
interfaceName: z.string().optional(),
ipVersion: z.string().optional(),
})

export const TlsNodeConfigValidator = SimpleNodeConfigValidator.extend({
Expand Down

0 comments on commit f8da0f3

Please sign in to comment.