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

功能请求:重载配置文件时将正在使用不存在的路由的玩家踢出 #153

Open
Ikaleio opened this issue Sep 27, 2024 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Ikaleio
Copy link

Ikaleio commented Sep 27, 2024

例如原有 hypixel-in,但新配置文件无此路由,则将使用 hypixel-in 的用户全部踢出。

@OOPSgary
Copy link
Contributor

@d0j1a1701 我看了一下 ZBProxy的热重载是基于服务的重载 不会新增端口/删除端口 如果需要全部踢出 建议直接重启程序

@Ikaleio
Copy link
Author

Ikaleio commented Sep 28, 2024

我指单独掐掉某个路由的连接(一开始的表述不太清楚,把「路由」打成了「服务」)

例如示例配置文件:

{
  "Log": {
    "Level": "info"
  },
  "Services": [
    {
      "Name": "in",
      "Listen": 25565
    }
  ],
  "Router": {
    "DefaultOutbound": "RESET",
    "Rules": [
      {
        "Type": "always",
        "Sniff": "minecraft"
      },
      {
        "Type": "MinecraftHostname",
        "Parameter": {
            "Domain": "a.example.com"
        },
        "Outbound": "a-out"
      },
      {
        "Type": "MinecraftHostname",
        "Parameter": {
            "Domain": "b.example.com"
        },
        "Outbound": "b-out"
      }
    ]
  },
  "Outbounds": [
    {
      "Name": "a-out",
      "TargetAddress": "mc.hypixel.net",
      "TargetPort": 25565,
      "Minecraft": {
        "EnableHostnameRewrite": true,
        "OnlineCount": {
          "Max": 20,
          "Online": -1,
          "EnableMaxLimit": false
        },
        "MotdDescription": "a's MOTD"
      }
    },
    {
      "Name": "b-out",
      "TargetAddress": "minemen.club",
      "TargetPort": 25565,
      "Minecraft": {
        "EnableHostnameRewrite": true,
        "OnlineCount": {
          "Max": 20,
          "Online": -1,
          "EnableMaxLimit": false
        },
        "MotdDescription": "b's MOTD"
      }
    }
  ],
  "Lists": {}
}

现在玩家 A 在用 a.example.com 玩,玩家 B 在用 b.example.com 玩

然后重载新配置文件:

{
  "Log": {
    "Level": "info"
  },
  "Services": [
    {
      "Name": "in",
      "Listen": 25565
    }
  ],
  "Router": {
    "DefaultOutbound": "RESET",
    "Rules": [
      {
        "Type": "always",
        "Sniff": "minecraft"
      },
      {
        "Type": "MinecraftHostname",
        "Parameter": {
            "Domain": "b.example.com"
        },
        "Outbound": "b-out"
      }
    ]
  },
  "Outbounds": [
    {
      "Name": "b-out",
      "TargetAddress": "minemen.club",
      "TargetPort": 25565,
      "Minecraft": {
        "EnableHostnameRewrite": true,
        "OnlineCount": {
          "Max": 20,
          "Online": -1,
          "EnableMaxLimit": false
        },
        "MotdDescription": "b's MOTD"
      }
    }
  ],
  "Lists": {}
}

可以发现玩家 A 游玩的服务器的路由没了,就把他断开连接。

@OOPSgary
Copy link
Contributor

@d0j1a1701 进一下tg群

@layou233 layou233 added enhancement New feature or request help wanted Extra attention is needed labels Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants