Code Monkey home page Code Monkey logo

v2sub's People

Contributors

arkrz avatar hwloser avatar kang8 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

v2sub's Issues

未获取到订阅信息

订阅信息在windows上是能用的,用这个工具在ubuntu shell上面输入就会显示
image

建议增加交互

有些选项一般只会改一次, 除了命令行参数里设置, 还可以在第一次运行的时候进行(自定义参数也有一个确认, 让普通用户保持默认)配置, 比如是否按延迟排序, 端口设置等
目前已经有要求用户输入订阅链接的相关代码了, 改起来会更容易些

		if cfg.SubUrl == "" {
			fmt.Print("输入订阅地址:")
			_, _ = fmt.Scan(&cfg.SubUrl)
		} else {
			fmt.Printf("订阅地址: %s\n", cfg.SubUrl)
		}

用户那边像这样

输入订阅地址:[用户输入https://xx.com/xx]
是否自定义参数(y或n, 默认:n) [用户输入 y]
http端口(默认:1080) [用户输入10809]
sock端口(默认:1081) [用户输入enter]
是否按延迟排序(y或n, 默认:y) [用户输入enter]

重启失败

在选择节点之后,重启v2ray服务失败。exit status 5

因为环境不支持systemctl问题请教

因为环境是docker云服务无法更改一下环境,就无法使用systemctl管理,我使用绝对路径之后

fmt.Println("重启 v2ray 服务...")
		if err = exec.Command("systemctl", "restart", "v2ray.service").Run(); err != nil {
			fmt.Printf("重启失败: %v\n", err)
			return
		}
	}

但是运行显示成功,但是查看端口没有
运行信息:
输入节点序号:26

输入节点序号:26
[🇺🇸 美国01-VIP] Ping: -1ms
重启 v2ray 服务...

开始监听...
socks://127.0.0.1:7891
http://127.0.0.1:7890

All done.

再次查看程序都跑着就是无法监听端口

输入节点序号:12
[🇭🇰 香港10-流媒体] Ping: 0ms
重启 v2ray 服务...

开始监听...
socks://127.0.0.1:10808
http://127.0.0.1:10809

All done.
root@sa0:~/data/v2sub# ss -tuln | grep LISTEN
tcp    LISTEN  0       128            0.0.0.0:22          0.0.0.0:*             
tcp    LISTEN  0       128            0.0.0.0:6007        0.0.0.0:*             
tcp    LISTEN  0       128            0.0.0.0:8888        0.0.0.0:*             
tcp    LISTEN  0       128               [::]:22             [::]:*             
tcp    LISTEN  0       4096                 *:2022              *:*             
root@autodl-container-9cdf118dfa-73294360:~/data/v2sub# ps -ef | grep v2ray
root      22998   6869  0 Nov30 pts/0    00:00:00 screen -S v2ray
root      22999  22998  0 Nov30 ?        00:00:00 SCREEN -S v2ray
root      39588  29138  0 00:20 pts/13   00:00:00 grep --color=auto v2ray
root@sa:~/data/v2sub# ./v2sub -help

建议在go程序里面不读取环境变量设置的代理

我设置http-proxy等环境变量让系统里的程序自动使用v2ray代理, 路由规则的是绕过大陆.
当节点不可用的时候, 我用本程序v2sub -sub更新订阅[1]设置代理的时候却发现因为节点不可用, 且程序走了代理, 无法获取在境外服务器上的订阅信息.
[1]默认不使用最新的订阅, 这可能是你没发现问题的原因, 因为有可能出现缓存订阅里的节点全部失效的情况, 因此这个issue是需要解决的
我的解决办法是在
func GetSub(url string, ch chan<- []string)
函数第一行加上
http.DefaultTransport.(*http.Transport).Proxy = nil

能否过滤掉trojan节点

trojan需要单独安装,而且trojan和v2ray同时运行(好像程序代码里运行trojan服务时不会关闭v2ray)要考虑端口占用的问题,如果能过滤掉trojan节点就不用管这个了

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.