rikkix / v2gen Goto Github PK
View Code? Open in Web Editor NEWA powerful cross-platform CLI client for V2Ray subscription. 跨平台V2Ray命令行订阅管理客户端
License: MIT License
A powerful cross-platform CLI client for V2Ray subscription. 跨平台V2Ray命令行订阅管理客户端
License: MIT License
Hi,
I noticed that the v2gen can only support the subscribe url as the input, could you please let v2gen can parse the vmess:// link directly?
There info beside each node like "(2 errors)". I'm wondering what these are and how to check in more detail. Currently all my nodes have pings of 0.
Use the lowest real delay node to generate v2ray config is helpful. 😄
Auto release a new version when there is a new release on v2ray-core.
Describe the bug
Can't run the program
To Reproduce
Steps to reproduce the behavior:
Download the latest version release and run it
./v2gen_amd64_linux: line 1: syntax error near unexpected token `newline'
./v2gen_amd64_linux: line 1: `!<arch>'
Desktop (please complete the following information):
I found that the executable file size is only about 10kb, which is not normal for a golang application
The release and compiled versions of V1.4.2 also have problems
V1.4.1 looks normal?
Hi,
Thanks a lot for your reply. Now I want to have following feather with v2gen:
1- Setting the inbounds ports for specific protocols using as argument of v2gen.
So that it can be used in for-loop for setting multiple config files.
2- Only generate the inbounds and outbound parts of the config.
Could you please add these functions into v2gen?
Hi,
See the following:
$ git clone https://github.com/iochen/V2Gen.git V2Gen.git
$ cd V2Gen.git
$ go build -o ./v2gen
go: cannot find main module, but found .git/config in /home/werner/software/anti-gfw/socks5/v2ray/V2Gen.git
to create a module there, run:
go mod init
$
Any hints?
TODO:
multi thread speedtest
in Version 1.3.1
To avoid being tracked, please use the latest version(>=V1.4.2), which is powered by the latest v2ray core.
More info:
v2ray/discussion#704
v2ray/v2ray-core#2510
v2ray/v2ray-core#2512
我设置了v2gen的v2gen.ini里的httpPort,但是我再次生成v2配置文件时,他的输出端口还是1080
I think this maybe more convenient for using:
If not using ``-p string'', let the result print to stdout.
Could you please add this fearture?
能不能把所有的节点输出成outbounds.json
节点名 用tag来标记,或者用1,2,3,4等数字也行。
这样订阅对于v2ray的意义可能更大。
因为v2ray-croe现在(v4.38.0+)是支持每隔一段时间测试节点并选择随机节点或HTTPS GET 请求完成时间最快的节点。
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
run v2gen -u "https://api.xinjie.eu.org/link/89j4g4oET" -o "-"
Expected behavior
show list
Desktop (please complete the following information):
Additional context
`2020/08/17 11:32:59 v2ray.com/core/infra/conf: failed to parse to outbound detour config. > invalid character '<' looking for beginning of value
2020/08/17 11:32:59 v2ray.com/core/infra/conf: failed to parse to outbound detour config. > invalid character '<' looking for beginning of value
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x794d62]
goroutine 11 [running]:
v2ray.com/core.(*Instance).Start(0x0, 0x0, 0x0)
/home/runner/work/v2gen/v2gen/go/src/v2ray.com/core/v2ray.go:311 +0x42
iochen.com/v2gen/app/ping/vmessping.VmessPing(0xc00005c728, 0x3, 0xd06f21, 0x24, 0x19, 0x8, 0x0, 0x0, 0x0, 0x0)
/home/runner/work/v2gen/v2gen/go/src/iochen.com/v2gen/app/ping/vmessping/vmessping.go:17 +0xe1
iochen.com/v2gen.Ping(0xc00005c728, 0x0, 0x0, 0x0)
/home/runner/work/v2gen/v2gen/go/src/iochen.com/v2gen/ping.go:106 +0x139
iochen.com/v2gen.MakeNode(0x0, 0xc000437600, 0x17, 0xc000437560, 0x11, 0xb97920, 0xc0000364d8, 0xc00003a510, 0x24, 0x0, ...)
/home/runner/work/v2gen/v2gen/go/src/iochen.com/v2gen/ping.go:87 +0x2f
created by iochen.com/v2gen.PingNodes.func1
/home/runner/work/v2gen/v2gen/go/src/iochen.com/v2gen/ping.go:55 +0x152
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x794d62]
goroutine 12 [running]:
v2ray.com/core.(*Instance).Start(0x0, 0x0, 0x0)
/home/runner/work/v2gen/v2gen/go/src/v2ray.com/core/v2ray.go:311 +0x42
iochen.com/v2gen/app/ping/vmessping.VmessPing(0xc00005cf28, 0x3, 0xd06f21, 0x24, 0x19, 0x8, 0x0, 0x0, 0x0, 0x0)
/home/runner/work/v2gen/v2gen/go/src/iochen.com/v2gen/app/ping/vmessping/vmessping.go:17 +0xe1
iochen.com/v2gen.Ping(0xc00005cf28, 0x0, 0x0, 0x0)
/home/runner/work/v2gen/v2gen/go/src/iochen.com/v2gen/ping.go:106 +0x139
iochen.com/v2gen.MakeNode(0x1, 0xc000437680, 0x19, 0xc000437640, 0x11, 0xb97920, 0xc0000364f8, 0xc00003a540, 0x24, 0x0, ...)
/home/runner/work/v2gen/v2gen/go/src/iochen.com/v2gen/ping.go:87 +0x2f
created by iochen.com/v2gen.PingNodes.func1
/home/runner/work/v2gen/v2gen/go/src/iochen.com/v2gen/ping.go:55 +0x152
`
See the following:
$ ./v2gen --init
panic: open /etc/v2ray/v2gen.ini: no such file or directory
goroutine 1 [running]:
main.checkErr(...)
/home/werner/software/anti-gfw/socks5/v2ray/V2Gen.git/main.go:64
main.main()
/home/werner/software/anti-gfw/socks5/v2ray/V2Gen.git/main.go:45 +0x1ef
是给linux云服务器使用,通过README的方法能获取配置却没找到启动代理的方法
我这一堆的节点,好几分钟不损失测试完毕了,结果你就然我选一个??
有点不太行,
root@hw:~/test/v2tproxy# ./v2gen -h
Usage of ./v2gen:
-best
use best node judged by ping result
-c string
v2gen config path (default "/etc/v2ray/v2gen.ini")
-ct int
ping count for each node (default 3)
-dest string
test destination url (vmess ping only) (default "https://cloudflare.com/cdn-cgi/trace")
-eto int
timeout seconds for each request (default 8)
-ic
use ICMP ping instead of vmess ping
-init
initialize v2gen config
-med
use median instead of ArithmeticMean
-n int
node index (default -1)
-np
do not ping
-o string
output path (default "/etc/v2ray/config.json")
-r random node index
-sort
sort ping results
-t int
threads used when pinging (default 5)
-tpl string
V2Ray tpl path
-tto int
timeout seconds for each node (default 25)
-u string
subscription URL
-v show version
-vmess string
vmess link(s)
root@hw:~/test/v2tproxy# cat Dockerfile
FROM alpine
RUN apk update && apk add bash wget curl
COPY v2gen /bin
ENTRYPOINT ["v2gen","-h"]
root@hw:~/test/v2tproxy# docker build .
Sending build context to Docker daemon 6.264MB
Step 1/4 : FROM alpine
---> f70734b6a266
Step 2/4 : RUN apk update && apk add bash wget curl
---> Using cache
---> e1f545f422cb
Step 3/4 : COPY v2gen /bin
---> Using cache
---> c07a856be4c9
Step 4/4 : ENTRYPOINT ["v2gen","-h"]
---> Running in 38f2f9464628
Removing intermediate container 38f2f9464628
---> d06c197a5cf2
Successfully built d06c197a5cf2
root@hw:~/test/v2tproxy# docker run -it --rm d06c19
root@hw:~/test/v2tproxy#
No matter what command it is, it cannot be executed.
To follow custom.
Currently, I want to use node VMess
link to generate config.json file, but I can not find correct way to generate it.
目前不少服务商推出了云中转服务,使用ICMP进行测试变得没有太多实际意义,建议使用以下函数替代ping函数。
https://github.com/ld000/freess-crawler/blob/master/test_methods/ping.go#L47:6
Hi,
See the following example:
Taken from here: https://free-ss.site/
vmess://eyJwcyI6IltmcmVlLXNzLnNpdGVdd3d3Lmtlcm5lbHMuYmlkIiwiYWRkIjoid3d3Lmtlcm5lbHMuYmlkIiwicG9ydCI6IjQ0MyIsImlkIjoiNGY4MjJiNzEtMTBhMS05ZTM3LTg0YzgtNzgwY2MzY2ZkMmM2IiwiYWlkIjoiMCIsIm5ldCI6IndzIiwidHlwZSI6Im5vbmUiLCJob3N0IjoiL3dzIiwidGxzIjoidGxzIn0=
For the field: "host":"/ws", v2gen will give the following:
```
"wsSettings": {
"path": "{{path}}",
"headers": {
"Host": "/ws"
}
}
But, in fact, the above setting will not work, the correct should be the following:
"wsSettings": {
"path": "/ws"
}
You can see it from here:
https://free-ss.site/v/443.json
Regards
比如1-12
选择序号为1到12的服务器
比如1,3,5,6,7
选择序号为1、3、5、6、7
的服务器
root@VM-0-7-debian:~/v2ray# ./v2gen_amd64_linux --init
v2gen v2.0.1, V2Ray 4.31.0 (go1.15.8 1cores linux/amd64)
panic: open /etc/v2ray/v2gen.ini: no such file or directory
goroutine 1 [running]:
main.main()
/home/runner/work/v2gen/v2gen/cmd/v2gen/main.go:163 +0x20a5
root@VM-0-7-debian:~/v2ray# ./v2gen_amd64_linux -init
v2gen v2.0.1, V2Ray 4.31.0 (go1.15.8 1cores linux/amd64)
panic: open /etc/v2ray/v2gen.ini: no such file or directory
goroutine 1 [running]:
main.main()
/home/runner/work/v2gen/v2gen/cmd/v2gen/main.go:163 +0x20a5
Hi,
See here:
https://github.com/2dust/v2rayN/blob/master/v2rayN/v2rayN/Handler/ConfigHandler.cs
The following section in this file:
This explained the previously discussed issues:
I custom a tpl from https://toutyrater.github.io/app/tproxy.html , but it not work.
root@hw:~/test/v2tproxy# ./test.sh
panic: unexpected end of JSON input
goroutine 1 [running]:
main.main()
/home/runner/work/v2gen/v2gen/go/src/iochen.com/v2gen/cmd/main.go:42 +0x2ff
root@hw:~/test/v2tproxy#
how to custom a tpl?
my custom tpl:
{
"log": {
"loglevel": "{{loglevel}}"
},
"inbounds": [
{
"tag":"transparent",
"port": 12345,
"protocol": "dokodemo-door",
"settings": {
"network": "tcp,udp",
"followRedirect": true
},
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
]
},
"streamSettings": {
"sockopt": {
"tproxy": "tproxy"
}
}
},
{
"port": {{socksPort}},
"protocol": "socks",
"sniffing": {
"enabled": true,
"destOverride": ["http", "tls"]
},
"settings": {
"udp": {{udp}}
}
},
{
"port": {{httpPort}},
"protocol": "http",
"settings": {
"udp": {{udp}}
}
}
],
"outbounds": [
{
"tag": "proxy",
"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}},
"sockopt": {
"mark": 255
},
"mux": {
"enabled": {{mux}},
"concurrency": {{concurrency}}
}
}
},
{
"tag": "direct",
"protocol": "freedom",
"settings": {
"domainStrategy": "UseIP"
},
"streamSettings": {
"sockopt": {
"mark": 255
}
}
},
{
"tag": "dns-out",
"protocol": "dns",
"streamSettings": {
"sockopt": {
"mark": 255
}
}
}
],
"dns": {
"servers": [
"8.8.8.8",
"1.1.1.1",
"114.114.114.114",
{
"address": "223.5.5.5",
"port": 53,
"domains": [
"geosite:cn",
"ntp.org",
"localhost"
]
}
]
},
"routing": {
"domainStrategy": "IPOnDemand",
"rules": [
{
"type": "field",
"inboundTag": [
"transparent"
],
"port": 53,
"network": "udp",
"outboundTag": "dns-out"
},
{
"type": "field",
"inboundTag": [
"transparent"
],
"port": 123,
"network": "udp",
"outboundTag": "direct"
},
{
"type": "field",
"ip": [
"223.5.5.5",
"114.114.114.114"
],
"outboundTag": "direct"
},
{
"type": "field",
"ip": [
"8.8.8.8",
"1.1.1.1"
],
"outboundTag": "proxy"
},
{
"type": "field",
"protocol":["bittorrent"],
"outboundTag": "direct"
},
{
"type": "field",
"ip": [
"geoip:private",
"geoip:cn"
],
"outboundTag": "direct"
},
{
"type": "field",
"domain": [
"geosite:cn"
],
"outboundTag": "direct"
}
]
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.