Comments (6)
If just use v2gen.ini
, the v2gen config will be hard to edit.
It will be sovled in next version, by allowing user to use their own v2ray config template.
from v2gen.
If just use
v2gen.ini
, the v2gen config will be hard to edit.
It will be sovled in next version, by allowing user to use their own v2ray config template.
In the latest version,
use --tpl v2rayconfig.tpl
to do that
from v2gen.
Failed to test this function, see my following steps:
Firstly, I use the v2rayconfig.tpl which has the following content:
$ cat v2rayconfig.tpl
{
"inbounds": [
{
"port": 8888,
"protocol": "socks"
}
],
"outbound": {
"protocol": "vmess",
"settings": {
"vnext": [
{
"address": "",
"port": "",
"users": [
{
"id": "",
"alterId": "",
"security": "aes-256-gcm"
}
]
}
]
},
"streamSettings": {
"network": "",
"security": "",
"tlsSettings": null,
"kcpSettings": null,
"wsSettings": null,
"httpSettings": null,
"quicSettings": null
}
}
}
Then I do the test as follows:
$ ./v2gen -tpl ./v2rayconfig.tpl -vmess vmess://eyJhZGQiOiI0NS4zMi44NC4xMzQiLCJhaWQiOiIxIiwiaG9zdCI6IiIsImlkIjoiOTM2NzAxYmUtNmJkNS0yMjc5LWRmZTAtZjBjNTUzMDczNzExIiwibmV0IjoidGNwIiwicGF0aCI6IiIsInBvcnQiOjM5MDAzLCJwcyI6IlNTUlRPT0wuQ09NIiwidGxzIjoiIiwidHlwZSI6Im5vbmUiLCJ2IjoiMiJ9 -p "" -silent
{
"inbounds": [
{
"port": 8888,
"protocol": "socks"
}
],
"outbound": {
"protocol": "vmess",
"settings": {
"vnext": [
{
"address": "",
"port": "",
"users": [
{
"id": "",
"alterId": "",
"security": "aes-256-gcm"
}
]
}
]
},
"streamSettings": {
"network": "",
"security": "",
"tlsSettings": null,
"kcpSettings": null,
"wsSettings": null,
"httpSettings": null,
"quicSettings": null
}
}
}
As you can see, the corresponding field value don't feed the tpl file. Any hints?
from v2gen.
It should be like
{
"log": {
"loglevel": "{{loglevel}}"
},
"inbounds": [
{
"port": {{socksPort}},
"protocol": "socks",
"settings": {
"udp": {{udp}}
}
},
{
"port": {{httpPort}},
"protocol": "http",
"settings": {
"udp": {{udp}}
}
}
],
"outbound": {
"protocol": "vmess",
"settings": {
"vnext": [
{
"address": "{{address}}",
"port": {{serverPort}},
"users": [
{
"id": "{{uuid}}",
"alterId": {{aid}},
"security": "{{security}}"
}
]
}
]
},
"streamSettings": {
"network": "{{network}}",
"security": "{{streamSecurity}}",
"tlsSettings": {{tls}},
"kcpSettings": {{kcp}},
"wsSettings": {{ws}},
"httpSettings": {{http}},
"quicSettings": {{quic}}
},
"mux": {
"enabled": {{mux}},
"concurrency": {{concurrency}}
}
},
"dns": {
"servers": [
"{{dns1}}",
"{{dns2}}",
"localhost"
]
},
"outboundDetour": [
{
"protocol": "freedom",
"settings": {},
"tag": "direct"
}
],
"routing": {
"strategy": "rules",
"settings": {
"domainStrategy": "IPIfNonMatch",
"rules": [{{china_sites}}
{
"type": "field",
"outboundTag": "direct",
"ip": [{{china_ip}}
"geoip:private"
]
}
]
}
}
}
It will replace {{foo}}
with bar
in v2gen config, with the line foo bar
in v2gen config.
uuid
aid
address
serverPort
depend on the vmess://xxxx uri
from v2gen.
Are these variables' name are defined by you or from the specification of v2ray?
from v2gen.
Both.
You can use your own variable names too.
from v2gen.
Related Issues (20)
- Add feature to automatically generate v2ray config file by the lowest real delay node
- Can not run with alpine HOT 1
- How to use -tpl? HOT 1
- Please use the latest version
- Use "vX.X.X" instead of "VX.X.X"
- Separate different modules HOT 1
- Auto release hooked by v2ray-core HOT 1
- Can't run the program HOT 3
- Runing `v2gen -u "https://api.xinjie.eu.org/link/89j4g4oET" -o "-"` leads to error HOT 4
- 输出端口更改无效 HOT 2
- 请问如何选择多个服务器地址 HOT 1
- ./v2gen_amd64_linux --init or ./v2gen_amd64_linux -init 报错 HOT 8
- 只能用于vmess解析吗 是否适用ss、ssr、vles HOT 1
- How to check what the errors are?
- 能不能把所有的节点输出成outbounds.json
- How to generate config.json file from `VMess` link?
- 不知改该如何启动代理,只能获得配置 HOT 2
- 有点问题,但是具体是啥问题我也不清楚,写正文里吧 HOT 1
- 能保留多个 节点吗? HOT 2
- TODO: multi thread speedtest
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from v2gen.