Files
v2ray_simple/version.go
hahahrfool 548675e002 添加自定义网络层功能;添加udp网络层支持
配置中,listen和dial中,可添加 network = "udp" 字段,不添加则默认tcp
2022-03-21 21:19:31 +08:00

58 lines
1.9 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*Package main 读取配置文件,将其内容转化为 proxy.Client和 proxy.Server然后进行代理转发.
命令行参数请使用 --help查看详情。
如果一个命令行参数无法在标准配置中进行配置,那么它就属于高级选项,或者不推荐的选项,或者正在开发中的功能.
Config Format 配置格式
一共有三种配置格式,极简模式,标准模式,兼容模式。
“极简模式”(即 verysimple mode)入口和出口仅有一个而且都是使用共享链接的url格式来配置.
标准模式使用toml格式。
兼容模式可以兼容v2ray现有json格式。暂未实现
极简模式的理念是,配置文件的字符尽量少,尽量短小精悍;
还有个命令行模式就是直接把极简模式的url 放到命令行参数中,比如:
verysimple -L socks5://sfdfsaf -D direct://
Structure 本项目结构
main -> proxy.Standard(配置文件) -> netLayer-> tlsLayer -> httpLayer -> ws -> proxy.
main中读取配置文件生成 Dail、Listen 和 RoutePolicy 对象后,开始监听;
用 netLayer操纵路由用tlsLayer嗅探tls用httpLayer操纵回落可选经过ws, 然后都搞好后传到proxy然后就开始转发
Other - 其他
另外本作暂时不考虑引入外界log包。依赖越少越好。
*/
package main
import (
"fmt"
"runtime"
"github.com/hahahrfool/v2ray_simple/netLayer"
)
var Version string //版本号由 Makefile 里的 BUILD_VERSION 指定
func printVersion() {
const desc = "verysimple, a very simple implementation of V2Ray with some innovation"
fmt.Printf("===============================\nverysimple %v (%v), %v %v %v\n", Version, desc, runtime.Version(), runtime.GOOS, runtime.GOARCH)
fmt.Println("Support tls and websocket for all protocols.")
if netLayer.HasEmbedGeoip() {
fmt.Println("Contains embeded Geoip file")
}
}