Closed X-Oracle closed 1 year ago
I think this can be a great temp solution, but what if we want an inbound to be working on multiple nodes?
Yeah. I think that's a great idea, but this solution could be better. I think ip is not a great choice for node seperation because it might change any time.
I think this can be a great temp solution, but what if we want an inbound to be working on multiple nodes?
Well in that case we can make it a list of ips instead of a single ip string.
I do proper changes .
I think ip is not a great choice for node seperation because it might change any time.
The proper way would be that marzban send a name or id which was required when registering a new node , to the node server when connecting to it .
Only In that case we can use name or id to do the identification.
But for now it is the only way I can think of .
also, I changed "node_ip" to "node_ips".
now it should be like this ...
"inbounds" : [
{
"node_ips": [
"1.2.3.4",
"5.6.7.8"
]
// other settings
}
// other inbounds
]
The proper way would be that marzban send a name or id which was required when registering a new node , to the node server when connecting to it .
Only In that case we can use name or id to do the identification.
But for now it is the only way I can think of .
You're right, but I think we should do it now rather than later. we might get in to some troubles migrating from this to something else in the future. @SaintShit what do you think?
You're right, but I think we should do it now rather than later. we might get in to some troubles migrating from this to something else in the future.
With these changes admin only needs to change xray-config of the main server.
And these configs won't do harm unless they conflict with xray objects which is not the case here.
And if Marzban gets an update to support similar and better functionality then this PR changes can easily be ignored or removed. Like I said before...
For bellow conditions this future won't be used, and the behavior would be just like before (adding all inbounds to node Xray):
- If "node_ip" was not used in any inbounds.
I meant for the people using this feature, if we remove this in an update later people might have some difficulty to migrate to the new version.
it's just a thought that we should consider. sorry I can't submit a review now because I didn't check/test the code yet, but I'll try my best to do it as soon as possible.
I think ip is not a great choice for node seperation because it might change any time.
@govfvck Now 'node_ips' can get both ips and domains . https://github.com/Gozargah/Marzban-node/pull/16/commits/4e099ee551f2a07d55dda88b9e2a03d1016f61e3 so, when admins change domain ip it will change too. it will use node dns to resolve the domains then do the comparison.
This is an optional feature which allows admins to specify which inbounds should be used in node Xray.
Benefits :
This is compatible with current Marzban and needs nothing to be done in Master server python codes.
In order to use this future Admin needs to add one key called "node_ip" in inbounds wanted to only be used in node Xray. like:
For bellow conditions this future won't be used, and the behavior would be just like before (adding all inbounds to node Xray):