Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[功能请求] 能否加入node组的概念 #648

Open
imshuai opened this issue Jan 11, 2025 · 2 comments
Open

[功能请求] 能否加入node组的概念 #648

imshuai opened this issue Jan 11, 2025 · 2 comments

Comments

@imshuai
Copy link

imshuai commented Jan 11, 2025

目前没找到关于node组的配置,是否有计划增加支持?

举例来说,目前一个hop里面可以配置多个node节点,通过选择器来选择不同的节点使用。但是在配置多个node时,如果connector和dialer的配置都是一样的,需要重复编写N次。

引入nodeGroup概念后,可以对connector和dialer配置相同的node分到同一组,仅设置一次connector和dialer配置,各个不同node仅需配置不同的addr参数即可,配置文件形如:

hops:
  - name: hop-0
    selector:
      strategy: fifo
      maxFails: 1
      failTimeout: 0s
    nodes:
      - name: node-0
        addr: 1.1.1.1:1080
        connector:
          type: socks5
        dialer:
          type: tcp
    nodeGroup:
      - name: nodeGroup-0
         connector:
           type: relay
         dialer:
           type: tcp
         nodes:
           - name: node-1
             addr: 2.2.2.2:2022
           - name: node-2
             addr: 3.3.3.3:2033
           - name: node-3
             addr: 4.4.4.4:2044
@ginuerzh
Copy link
Member

ginuerzh commented Jan 12, 2025

如果能在现有的结构上简单的扩展就不建议增加新的结构。例如可以定义一种引用类型的节点来共享配置,并可以覆写部分字段

nodes:
  - name: node-0
    addr: 1.1.1.1:1080
    connector:
      type: socks5
    dialer:
      type: tcp
  - name: node-1
    ref: node-0
    addr: 1.1.1.1:1080

node-1节点通过ref字段来引用node-0,与node-0使用相同的配置,并通过覆写addr字段来定义自己的地址。

@imshuai
Copy link
Author

imshuai commented Jan 14, 2025

如果能在现有的结构上简单的扩展就不建议增加新的结构。例如可以定义一种引用类型的节点来共享配置,并可以覆写部分字段

这是一个很好的方案,期望能增加此功能

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants