Signed-off-by: arraykeys@gmail.com <arraykeys@gmail.com>
This commit is contained in:
16
README.md
16
README.md
@ -281,13 +281,13 @@ Local HTTP (S) proxy use 28080 port,excute:
|
|||||||
`./proxy http -T ssh -P "2.2.2.2:22" -u user -S user.key -t tcp -p ":28080"`
|
`./proxy http -T ssh -P "2.2.2.2:22" -u user -S user.key -t tcp -p ":28080"`
|
||||||
|
|
||||||
#### **1.8.KCP protocol transmission**
|
#### **1.8.KCP protocol transmission**
|
||||||
The KCP protocol requires a -B parameter to set a password which can encrypt and decrypt data.
|
The KCP protocol requires a --kcp-key parameter to set a password which can encrypt and decrypt data.
|
||||||
|
|
||||||
Http first level proxy(VPS,IP:22.22.22.22)
|
Http first level proxy(VPS,IP:22.22.22.22)
|
||||||
`./proxy http -t kcp -p ":38080" -B mypassword`
|
`./proxy http -t kcp -p ":38080" --kcp-key mypassword`
|
||||||
|
|
||||||
Http second level proxy(os is Linux)
|
Http second level proxy(os is Linux)
|
||||||
`./proxy http -t tcp -p ":8080" -T kcp -P "22.22.22.22:38080" -B mypassword`
|
`./proxy http -t tcp -p ":8080" -T kcp -P "22.22.22.22:38080" --kcp-key mypassword`
|
||||||
Then access to the local 8080 port is access to the proxy's port 38080 on the VPS, and the data is transmitted through the KCP protocol.
|
Then access to the local 8080 port is access to the proxy's port 38080 on the VPS, and the data is transmitted through the KCP protocol.
|
||||||
#### **1.9.HTTP reverse proxy**
|
#### **1.9.HTTP reverse proxy**
|
||||||
Proxy supports not only set up a proxy through in other software, to provide services for other software, but support the request directly to the website domain to proxy monitor IP when proxy monitors 80 and 443 ports, then proxy will automatically access to the HTTP proxy access website for you.
|
Proxy supports not only set up a proxy through in other software, to provide services for other software, but support the request directly to the website domain to proxy monitor IP when proxy monitors 80 and 443 ports, then proxy will automatically access to the HTTP proxy access website for you.
|
||||||
@ -657,13 +657,13 @@ ip: user's IP, for example: 192.168.1.200
|
|||||||
If there is no -a or -F or --auth-url parameters, it means to turn off the authentication.
|
If there is no -a or -F or --auth-url parameters, it means to turn off the authentication.
|
||||||
|
|
||||||
#### **5.8.KCP protocol transmission**
|
#### **5.8.KCP protocol transmission**
|
||||||
The KCP protocol requires a -B parameter which can set a password to encrypt and decrypt data.
|
The KCP protocol requires a --kcp-key parameter which can set a password to encrypt and decrypt data.
|
||||||
|
|
||||||
HTTP first level proxy(VPS,IP:22.22.22.22)
|
HTTP first level proxy(VPS,IP:22.22.22.22)
|
||||||
`./proxy socks -t kcp -p ":38080" -B mypassword`
|
`./proxy socks -t kcp -p ":38080" --kcp-key mypassword`
|
||||||
|
|
||||||
HTTP two level proxy(local os is Linux)
|
HTTP two level proxy(local os is Linux)
|
||||||
`./proxy socks -t tcp -p ":8080" -T kcp -P "22.22.22.22:38080" -B mypassword`
|
`./proxy socks -t tcp -p ":8080" -T kcp -P "22.22.22.22:38080" --kcp-key mypassword`
|
||||||
Then access to the local 8080 port is access to the proxy port 38080 on the VPS, and the data is transmitted through the KCP protocol.
|
Then access to the local 8080 port is access to the proxy port 38080 on the VPS, and the data is transmitted through the KCP protocol.
|
||||||
|
|
||||||
#### **5.9.Custom DNS**
|
#### **5.9.Custom DNS**
|
||||||
@ -692,7 +692,7 @@ command:
|
|||||||
|
|
||||||
Suppose there is a KCP HTTP (s) proxy (password: demo123): 127.0.0.1:8080. Now we turn it into a common proxy that supports HTTP (s) and Socks5 at the same time. The local port after transformation is 18080.
|
Suppose there is a KCP HTTP (s) proxy (password: demo123): 127.0.0.1:8080. Now we turn it into a common proxy that supports HTTP (s) and Socks5 at the same time. The local port after transformation is 18080.
|
||||||
command:
|
command:
|
||||||
`./proxy sps -S http -T kcp -P 127.0.0.1:8080 -t tcp -p :18080 -B demo123`
|
`./proxy sps -S http -T kcp -P 127.0.0.1:8080 -t tcp -p :18080 --kcp-key demo123`
|
||||||
|
|
||||||
#### **6.3.SOCKS5 to HTTP(S) + SOCKS5**
|
#### **6.3.SOCKS5 to HTTP(S) + SOCKS5**
|
||||||
Suppose there is a common Socks5 proxy: 127.0.0.1:8080, now we turn it into a common proxy that supports HTTP (s) and Socks5 at the same time, and the local port after transformation is 18080.
|
Suppose there is a common Socks5 proxy: 127.0.0.1:8080, now we turn it into a common proxy that supports HTTP (s) and Socks5 at the same time, and the local port after transformation is 18080.
|
||||||
@ -705,7 +705,7 @@ command:
|
|||||||
|
|
||||||
Suppose there is a KCP Socks5 proxy (password: demo123): 127.0.0.1:8080, now we turn it into a common proxy that support HTTP (s) and Socks5 at the same time, and the local port after transformation is 18080.
|
Suppose there is a KCP Socks5 proxy (password: demo123): 127.0.0.1:8080, now we turn it into a common proxy that support HTTP (s) and Socks5 at the same time, and the local port after transformation is 18080.
|
||||||
command:
|
command:
|
||||||
`./proxy sps -S socks -T kcp -P 127.0.0.1:8080 -t tcp -p :18080 -B demo123`
|
`./proxy sps -S socks -T kcp -P 127.0.0.1:8080 -t tcp -p :18080 --kcp-key demo123`
|
||||||
|
|
||||||
#### **6.4.Chain style connection**
|
#### **6.4.Chain style connection**
|
||||||
It is mentioned above that multiple SPS nodes can be connected to build encrypted channels, assuming you have the following VPS and a PC.
|
It is mentioned above that multiple SPS nodes can be connected to build encrypted channels, assuming you have the following VPS and a PC.
|
||||||
|
|||||||
16
README_ZH.md
16
README_ZH.md
@ -281,13 +281,13 @@ target:用户访问的URL,比如:http://demo.com:80/1.html或https://www.baidu.c
|
|||||||
`./proxy http -T ssh -P "2.2.2.2:22" -u user -S user.key -t tcp -p ":28080"`
|
`./proxy http -T ssh -P "2.2.2.2:22" -u user -S user.key -t tcp -p ":28080"`
|
||||||
|
|
||||||
#### **1.8.KCP协议传输**
|
#### **1.8.KCP协议传输**
|
||||||
KCP协议需要-B参数设置一个密码用于加密解密数据
|
KCP协议需要--kcp-key参数设置一个密码用于加密解密数据
|
||||||
|
|
||||||
一级HTTP代理(VPS,IP:22.22.22.22)
|
一级HTTP代理(VPS,IP:22.22.22.22)
|
||||||
`./proxy http -t kcp -p ":38080" -B mypassword`
|
`./proxy http -t kcp -p ":38080" --kcp-key mypassword`
|
||||||
|
|
||||||
二级HTTP代理(本地Linux)
|
二级HTTP代理(本地Linux)
|
||||||
`./proxy http -t tcp -p ":8080" -T kcp -P "22.22.22.22:38080" -B mypassword`
|
`./proxy http -t tcp -p ":8080" -T kcp -P "22.22.22.22:38080" --kcp-key mypassword`
|
||||||
那么访问本地的8080端口就是访问VPS上面的代理端口38080,数据通过kcp协议传输.
|
那么访问本地的8080端口就是访问VPS上面的代理端口38080,数据通过kcp协议传输.
|
||||||
|
|
||||||
#### **1.9 HTTP(S)反向代理**
|
#### **1.9 HTTP(S)反向代理**
|
||||||
@ -661,13 +661,13 @@ ip:用户的IP,比如:192.168.1.200
|
|||||||
如果没有-a或-F或--auth-url参数,就是关闭认证.
|
如果没有-a或-F或--auth-url参数,就是关闭认证.
|
||||||
|
|
||||||
#### **5.8.KCP协议传输**
|
#### **5.8.KCP协议传输**
|
||||||
KCP协议需要-B参数设置一个密码用于加密解密数据
|
KCP协议需要--kcp-key参数设置一个密码用于加密解密数据
|
||||||
|
|
||||||
一级HTTP代理(VPS,IP:22.22.22.22)
|
一级HTTP代理(VPS,IP:22.22.22.22)
|
||||||
`./proxy socks -t kcp -p ":38080" -B mypassword`
|
`./proxy socks -t kcp -p ":38080" --kcp-key mypassword`
|
||||||
|
|
||||||
二级HTTP代理(本地Linux)
|
二级HTTP代理(本地Linux)
|
||||||
`./proxy socks -t tcp -p ":8080" -T kcp -P "22.22.22.22:38080" -B mypassword`
|
`./proxy socks -t tcp -p ":8080" -T kcp -P "22.22.22.22:38080" --kcp-key mypassword`
|
||||||
那么访问本地的8080端口就是访问VPS上面的代理端口38080,数据通过kcp协议传输.
|
那么访问本地的8080端口就是访问VPS上面的代理端口38080,数据通过kcp协议传输.
|
||||||
|
|
||||||
#### **5.9.自定义DNS**
|
#### **5.9.自定义DNS**
|
||||||
@ -695,7 +695,7 @@ KCP协议需要-B参数设置一个密码用于加密解密数据
|
|||||||
|
|
||||||
假设已经存在一个kcp的http(s)代理(密码是:demo123):127.0.0.1:8080,现在我们把它转为同时支持http(s)和socks5的普通代理,转换后的本地端口为18080。
|
假设已经存在一个kcp的http(s)代理(密码是:demo123):127.0.0.1:8080,现在我们把它转为同时支持http(s)和socks5的普通代理,转换后的本地端口为18080。
|
||||||
命令如下:
|
命令如下:
|
||||||
`./proxy sps -S http -T kcp -P 127.0.0.1:8080 -t tcp -p :18080 -B demo123`
|
`./proxy sps -S http -T kcp -P 127.0.0.1:8080 -t tcp -p :18080 --kcp-key demo123`
|
||||||
|
|
||||||
#### **6.3 SOCKS5转HTTP(S)+SOCKS5**
|
#### **6.3 SOCKS5转HTTP(S)+SOCKS5**
|
||||||
假设已经存在一个普通的socks5代理:127.0.0.1:8080,现在我们把它转为同时支持http(s)和socks5的普通代理,转换后的本地端口为18080。
|
假设已经存在一个普通的socks5代理:127.0.0.1:8080,现在我们把它转为同时支持http(s)和socks5的普通代理,转换后的本地端口为18080。
|
||||||
@ -708,7 +708,7 @@ KCP协议需要-B参数设置一个密码用于加密解密数据
|
|||||||
|
|
||||||
假设已经存在一个kcp的socks5代理(密码是:demo123):127.0.0.1:8080,现在我们把它转为同时支持http(s)和socks5的普通代理,转换后的本地端口为18080。
|
假设已经存在一个kcp的socks5代理(密码是:demo123):127.0.0.1:8080,现在我们把它转为同时支持http(s)和socks5的普通代理,转换后的本地端口为18080。
|
||||||
命令如下:
|
命令如下:
|
||||||
`./proxy sps -S socks -T kcp -P 127.0.0.1:8080 -t tcp -p :18080 -B demo123`
|
`./proxy sps -S socks -T kcp -P 127.0.0.1:8080 -t tcp -p :18080 --kcp-key demo123`
|
||||||
|
|
||||||
#### **6.4 链式连接**
|
#### **6.4 链式连接**
|
||||||
上面提过多个sps结点可以层级连接构建加密通道,假设有如下vps和家里的pc电脑。
|
上面提过多个sps结点可以层级连接构建加密通道,假设有如下vps和家里的pc电脑。
|
||||||
|
|||||||
@ -93,6 +93,11 @@ func (s *MuxBridge) Start(args interface{}) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
keyInfo := strings.Split(key, "-")
|
keyInfo := strings.Split(key, "-")
|
||||||
|
if len(keyInfo) != 2 {
|
||||||
|
utils.CloseConn(&inConn)
|
||||||
|
log.Printf("client key format error,key:%s", key)
|
||||||
|
return
|
||||||
|
}
|
||||||
groupKey := keyInfo[0]
|
groupKey := keyInfo[0]
|
||||||
index := keyInfo[1]
|
index := keyInfo[1]
|
||||||
if !s.clientControlConns.Has(groupKey) {
|
if !s.clientControlConns.Has(groupKey) {
|
||||||
|
|||||||
Reference in New Issue
Block a user