Skip to content

API - Add | Remove Routing Rules #3189

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

Merged
merged 7 commits into from
Mar 29, 2024
Merged

API - Add | Remove Routing Rules #3189

merged 7 commits into from
Mar 29, 2024

Conversation

hossinasaadi
Copy link
Contributor

add rules : ./xray api adrules --server=127.0.0.1:62789 c1.json c2.json
remove rules : ./xray api rmrules --server=127.0.0.1:62789 ruleTag1 ruleTag2

also add ruleTag to identify rules.

{
...
    "routing": {
...
      "rules": [
        {
          "ruleTag" : "mainRule",
          "outboundTag": "api",
          "type": "field",
          "inboundTag": [
            "api"
          ]
        },
...

@Fangliding
Copy link
Member

It seems the test has failed

@vrnobody
Copy link
Contributor

How about replace the entire routing object? That is easier to implement and use. More over we can hot-switch some balancing strategies too.

@hossinasaadi
Copy link
Contributor Author

It seems the test has failed

now should be ok

Copy link
Member

@yuhan6665 yuhan6665 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your PR! This is an important new feature. I've made some comments. Looking forward to it

apply balancer config
@hossinasaadi
Copy link
Contributor Author

How about replace the entire routing object? That is easier to implement and use. More over we can hot-switch some balancing strategies too.

hot-switch balancer and replace|append new routing configs added.
@yuhan6665

@yuhan6665 yuhan6665 merged commit 53e5814 into XTLS:main Mar 29, 2024
@yuhan6665
Copy link
Member

Thanks a lot! When I have time, I will integrate #412 as the next step. (Primarily to support GetRoutingRules API)

@hossinasaadi
Copy link
Contributor Author

hossinasaadi commented Mar 29, 2024

Thanks a lot! When I have time, I will integrate #412 as the next step. (Primarily to support GetRoutingRules API)

glad to hear that.also i will check and see how can i help with that.

@hossinasaadi hossinasaadi deleted the api branch March 29, 2024 17:42
@mzbqhbc
Copy link

mzbqhbc commented Apr 10, 2024

I run the command line and get this error
failed to perform AddRule: rpc error: code = Unimplemented desc = unknown service xray.app.router.command.RoutingService

@hossinasaadi
Copy link
Contributor Author

RoutingService

I run the command line and get this error failed to perform AddRule: rpc error: code = Unimplemented desc = unknown service xray.app.router.command.RoutingService

    "api": {
      "services": [
        "RoutingService"
      ]
    },

@mzbqhbc
Copy link

mzbqhbc commented Apr 11, 2024

RoutingService

I run the command line and get this error failed to perform AddRule: rpc error: code = Unimplemented desc = unknown service xray.app.router.command.RoutingService

    "api": {
      "services": [
        "RoutingService"
      ]
    },

Thanks

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

Successfully merging this pull request may close these issues.

5 participants