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

values 是否支持默认值 #1163

Open
DiamondYuan opened this issue Oct 31, 2024 · 1 comment
Open

values 是否支持默认值 #1163

DiamondYuan opened this issue Oct 31, 2024 · 1 comment

Comments

@DiamondYuan
Copy link

https://www.qq.com proxy:127.0.0.1:{LOCAL_PORT}
https://www.qq.com proxy:127.0.0.1:8000

如何实现下面的规则

  1. LOCAL_PORT 有数据的时候,读取上一条
  2. LOCAL_PORT 没数据的时候,请求 127.0.0.1:8000
@avwo
Copy link
Owner

avwo commented Nov 15, 2024

可以用插件或 reqScript:https://wproxy.org/whistle/rules/reqScript.html

https://www.qq.com/ reqScript://{config.js}
``` config.js
const port = getValue('LOCAL_PORT')?.trim() || 8000;
rules.push(`https://www.qq.com/ proxy:127.0.0.1:${port}`);
```

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