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

add restrictedIPsPath flag for limit restricted IPs #1317

Closed
wants to merge 4 commits into from

Conversation

hossinasaadi
Copy link
Contributor

add -restrictedIPsPath blockedIPs.txt OR -rip blockedIPs.txt to Xray for drop connection from limited IPs.
stored IPs should be split by "," in the text file.
EX blockedIPs.txt content :
1.2.3.4,1.1.1.2,5.6.7.8
it's useful for limiting connected Different IPs to inbound at the same time.
like implemented for x-ui here

@yuhan6665
Copy link
Member

感谢 pr。能否通过路由配置 source 匹配源IP到黑洞达到相同的效果?
https://xtls.github.io/config/routing.html#ruleobject
IP还可以写进文件里面 像 geoip 一样

@hossinasaadi
Copy link
Contributor Author

Can the source match the source IP to the black hole by routing configuration to achieve the same effect

Hi @yuhan6665 , it's about online devices with different IPs on one Inbound Like Vmess.
when you limit an inbound to 1 IP (in your way at the panel or something), you can get User IPs from the access log and save extra IPs in the passed file to Xray core (blockedIPs.txt) and it will drop them.
in your way each time you should restart Xray

@yuhan6665
Copy link
Member

@hossinasaadi I see what you are talking about. Current proposal has a constant loading with time delay, which is not elegant. I'd suggest to find a way to add an API, so that routing rules can be changed dynamically.
https://xtls.github.io/config/api.html#%E6%94%AF%E6%8C%81%E7%9A%84-api-%E5%88%97%E8%A1%A8
This way is a lot more flexible and there would not be a time delay for the new rules to take effect

@yuhan6665
Copy link
Member

I just remember there is a kinda forgotten draft for this feature. You can take a look #412
If you can reinstate it we can probably merge. Thanks!

lk29 pushed a commit to lk29/Xray-core that referenced this pull request Feb 9, 2023
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.

2 participants