修订文档

This commit is contained in:
e1732a364fed
2022-04-25 21:42:24 +08:00
parent ba1135d0d5
commit 8725dc513a
8 changed files with 52 additions and 48 deletions

View File

@@ -21,17 +21,17 @@ jobs:
- name: Build
run: |
make -f Makefile_release extra PACK=1 BUILD_VERSION=${{ steps.get_version.outputs.VERSION }}
cd cmd/verysimple/ && make -f Makefile_release extra PACK=1 BUILD_VERSION=${{ steps.get_version.outputs.VERSION }}
- name: touch xz archive
shell: bash
run: |
touch -mt $(date +%Y01010000) *.tar.xz
cd cmd/verysimple/ && touch -mt $(date +%Y01010000) *.tar.xz
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./*.tar.xz
file: cmd/verysimple/*.tar.xz
tag: ${{ github.ref }}
file_glob: true

View File

@@ -76,13 +76,15 @@ mv domain-list-community geosite
```sh
git clone https://github.com/e1732a364fed/v2ray_simple
cd v2ray_simple && go build
cd v2ray_simple/cmd/verysimple && go build
```
详细优化的编译参数请参考Makefile文件
如果你是直接下载的可执行文件,则不需要 go build
注意本项目自v1.1.9开始,可执行文件的目录在 cmd/verysimple 文件夹内,而根目录 为 v2ray_simple 包。
## 运行方式
本作支持多种运行模式,方便不同需求的同学使用
@@ -100,18 +102,8 @@ cd v2ray_simple && go build
第一次运行时会自动下载geoip文件。
可选拷贝示例文件
```sh
#如果使用极简模式则复制vs.json文件
cp examples/vs.client.json client.json
cp examples/vs.server.json server.json
#如果使用 标准toml格式则复制toml文件我们提供了多种配置示例你只需复制一种想要的即可
cp examples/vlesss.client.toml client.toml
cp examples/vlesss.server.toml server.toml
```
如果你不拷贝示例文件,也可以通过 [交互模式](#交互模式) 来生成自定义的配置。
可以通过 [交互模式](#交互模式) 来生成自定义的配置。
### 极简模式
@@ -123,7 +115,7 @@ verysimple -c client.json
verysimple -c server.json
```
关于 vlesss 的配置,查看 server.example.json和 client.example.json就知道了很简单的。
关于 vlesss 的配置,查看 vs.server.json和 vs.client.json 就知道了,很简单的。
目前极简模式配置文件最短情况一共就4行其中两行还是花括号这要是还要我解释我就踢你的屁股。

View File

@@ -4,34 +4,8 @@
如果一个命令行参数无法在标准配置中进行配置,那么它就属于高级选项,或者不推荐的选项,或者正在开发中的功能.
Config Format 配置格式
一共有三种配置格式,极简模式,标准模式,兼容模式。
“极简模式”(即 verysimple mode)入口和出口仅有一个而且都是使用共享链接的url格式来配置.
标准模式使用toml格式。
兼容模式可以兼容v2ray现有json格式。暂未实现
极简模式的理念是,配置文件的字符尽量少,尽量短小精悍;
还有个命令行模式就是直接把极简模式的url 放到命令行参数中,比如:
verysimple -L socks5://sfdfsaf -D direct://
Structure 本项目结构
main -> proxy.Standard(配置文件) -> netLayer-> tlsLayer -> httpLayer -> advLayer -> proxy.
main.go 中,读取配置文件,生成 Dail、Listen 、 RoutePolicy 和 Fallback等 对象后,开始监听,并顺便选择性打开交互模式和 apiServer
具体 转发过程 的 调用链 是 listenSer -> handleNewIncomeConnection -> handshakeInserver_and_passToOutClient -> handshakeInserver -> passToOutClient ( -> checkfallback) -> dialClient_andRelay -> dialClient ( -> dialInnerMux ), netLayer.Relay / netLayer.RelayUDP
用 netLayer操纵路由用tlsLayer嗅探tls用httpLayer操纵回落可选经过ws/grpc, 然后都搞好后传到proxy然后就开始转发
当然如果遇到quic这种自己处理从传输层到高级层所有阶段的“超级协议”的话, 在操纵路由后直接传给 quic然后quic握手建立后直接传到 proxy
main.go 中,读取配置文件,生成 Dail、Listen 、 RoutePolicy 和 Fallback等 对象后,开始监听,并顺便选择性打开交互模式和 apiServer
*/
package main

35
doc.go Normal file
View File

@@ -0,0 +1,35 @@
/*
Package v2ray_simple provides a way to set up a proxy.
Config Format 配置格式
一共有三种配置格式,极简模式,标准模式,兼容模式。
“极简模式”(即 verysimple mode)入口和出口仅有一个而且都是使用共享链接的url格式来配置.
标准模式使用toml格式。
兼容模式可以兼容v2ray现有json格式。暂未实现
极简模式的理念是,配置文件的字符尽量少,尽量短小精悍;
还有个命令行模式就是直接把极简模式的url 放到命令行参数中,比如:
verysimple -L socks5://sfdfsaf -D direct://
Structure 本项目结构
utils -> netLayer-> tlsLayer -> httpLayer -> advLayer -> proxy -> v2ray_simple
Chain
具体 转发过程 的 调用链 是 ListenSer -> handleNewIncomeConnection -> handshakeInserver_and_passToOutClient -> handshakeInserver -> passToOutClient ( -> checkfallback) -> dialClient_andRelay -> dialClient ( -> dialInnerMux ), netLayer.Relay / netLayer.RelayUDP
用 netLayer操纵路由用tlsLayer嗅探tls用httpLayer操纵回落可选经过ws/grpc, 然后都搞好后传到proxy然后就开始转发
当然如果遇到quic这种自己处理从传输层到高级层所有阶段的“超级协议”的话, 在操纵路由后直接传给 quic然后quic握手建立后直接传到 proxy
*/
package v2ray_simple

View File

@@ -5,7 +5,7 @@
如果你用root账户运行的话不要在前面加 "sudo".
下面的命令也不要整个一大段拷贝,而要分条拷贝到vps并运行。
下面的命令也不要整个一大段拷贝,而要分条拷贝到终端并运行。
## 第〇步,准备
@@ -46,6 +46,8 @@ sudo cp examples/vlesss.server.toml server.toml
然后修改 `/usr/local/etc/verysimple/server.toml` ,使配置达到你想要的效果,注意里面证书路径要改为完整路径
你也可以不复制 配置文件,运行 `verysimple -i` 进入交互模式 生成一个你想要的配置。
## 第二步,证书部分

View File

@@ -1,6 +1,7 @@
# vless v1 讨论
目前v1仍然处于研发当中。建议先用v0等v1完全出炉了再说,本文只是理论探索,实际代码暂未完整实现所有的设计.
目前v1仍然处于研发当中。建议先用v0等v1 完善了再说,本文只是理论探索,标准的实现 实际暂未完整实现所有的设计.
## 握手协议格式
具体我的探讨的一部分还可以查看 https://github.com/v2fly/v2ray-core/discussions/1655

View File

@@ -86,7 +86,7 @@ func init() {
}
//非阻塞. 在main函数中被调用。也可以在 test代码中直接使用 ListenSer 函数 来手动开启新的转发流程。
//非阻塞. 可以 直接使用 ListenSer 函数 来手动开启新的转发流程。
// 若 not_temporary 为true, 则生成的listener将会被添加到 listenerArray 中
func ListenSer(inServer proxy.Server, defaultOutClientForThis proxy.Client, not_temporary bool) (thisListener net.Listener) {

View File

@@ -1,4 +1,4 @@
// Package utils provides utilities that is used in all codes in verysimple
// Package utils provides general utilities.
package utils
import (
@@ -22,7 +22,7 @@ type ByteReader interface {
Read(p []byte) (n int, err error)
}
// bytes.Buffer 实现了 ByteReader
// bytes.Buffer 实现了 ByteWriter
type ByteWriter interface {
WriteByte(byte) error
Write(p []byte) (n int, err error)