Skip to content

Commit

Permalink
publish site
Browse files Browse the repository at this point in the history
  • Loading branch information
snail007 committed Oct 17, 2019
1 parent 1593254 commit ff1b430
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 19 deletions.
67 changes: 58 additions & 9 deletions docs/manual/zh/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,9 @@ proxy的blocked,direct,stop,only,hosts,resolve.rules,rewriter.rules
`./proxy http -t tcp -p ":8080" -T tls -P "33.33.33.33:28080" -C proxy.crt -K proxy.key`
那么访问本地的8080端口就是访问一级HTTP代理上面的代理端口38080。

### 1.5.Basic认证
对于代理HTTP协议我们可以basic进行Basic认证,认证的用户名和密码可以在命令行指定
`./proxy http -t tcp -p ":33080" -a "user1:pass1" -a "user2:pass2"`
多个用户,重复-a参数即可。
也可以放在文件中,格式是一行一个"用户名:密码",然后用-F指定。
`./proxy http -t tcp -p ":33080" -F auth-file.txt`
### 1.5.Basic认证,API认证

请参考`9.API认证``10.本地认证`

### 1.6.HTTP代理流量强制走上级HTTP代理
默认情况下,proxy会智能判断一个网站域名是否无法访问,如果无法访问才走上级HTTP代理.通过--always可以使全部HTTP代理流量强制走上级HTTP代理。
Expand Down Expand Up @@ -953,6 +950,8 @@ SOCKS5支持级联认证,-A可以设置上级认证信息。

`proxy socks -T tcp -P 2.2.2.2:33080 -A user:pass -t tcp -p :33080`

请更多认证细节,请参考`9.API认证``10.本地认证`

### 5.16 证书参数使用base64数据

默认情况下-C,-K参数是crt证书和key文件的路径,
Expand Down Expand Up @@ -1061,6 +1060,8 @@ sps支持http(s)\socks5代理认证,可以级联认证,有四个重要的信
上级:`./proxy sps -S http -T tcp -P 127.0.0.1:8080 -t tcp -p ":33080" -a "user1:pass1:0:0:" -a "user2:pass2:0:0:"`
下级:`./proxy sps -S http -T tcp -P 127.0.0.1:8080 -A "user1:pass1" -t tcp -p ":33080" `

请更多认证细节,请参考`9.API认证``10.本地认证`

### 6.8 多个上级

如果存在多个上级,可以通过多个-P指定。
Expand Down Expand Up @@ -1345,7 +1346,7 @@ or
`proxy dns -S socks -T tcp -Z password -P 2.2.2.2:33080 -p :53`
那么本地的UDP端口53就提供了安全防污染DNS解析功能。

## 9.API认证
## 9.API认证,限速,控制连接数

proxy的http(s)/socks5/sps代理功能,支持通过API控制用户对代理对访问。

Expand Down Expand Up @@ -1405,10 +1406,11 @@ iprate:用户IP的单个TCP连接速率限制,单位:字节/秒,不限
upstream:使用的上级,没有为空,或者不设置这个头部。

#### 提示
1.默认情况下,设置了--auth-url是需要客户端提供用户名和密码的;如果不需要客户端提供用户名密码,并认证,可以加上--auth-nouser,每次访问仍然会访问认证地址--auth-url进行认证。只是php接口里面接收的$user认证用户名和$pass认证密码都为空。
1.默认情况下,设置了`--auth-url`是需要客户端提供用户名和密码的;如果不需要客户端提供用户名密码,并认证,可以加上`--auth-nouser`,每次访问仍然会访问认证地址`--auth-url`进行认证。只是php接口里面接收的$user认证用户名和$pass认证密码都为空。
2.连接数限制优先级:用户认证文件速率限制-》文件ip.limit速率限制-》API用户速率限制-》API的IP速率限制-》命令行全局连接数限制。
3.速率限制优先级:用户认证文件速率限制-》文件ip.limit速率限制-》API用户速率限制-》API的IP速率限制-》命令行全局速率限制。
3.上级获取优先级:用户认证文件的upstream-》文件ip.limit的upstream-》API的upstream-》命令行指定的上级。
4.`--auth-cache`认证缓存,对认证结果缓存一定时间,提升性能,降低认证接口压力,--auth-cache 单位秒,默认60, 设置0是关闭缓存。

#### upstream详细说明

Expand All @@ -1431,4 +1433,51 @@ upstream支持socks5、http(s)代理,支持认证,格式:`protocol://a:b@2
5. timeout : 建立tcp连接的超时时间,数字,单位毫秒
6. ca : 上级底层tls传输类型的ca证书文件经过base64编码后的字符串。
7. cert : 上级底层tls传输类型的证书文件经过base64编码后的字符串。
8. key : 上级底层tls传输类型的证书密钥文件经过base64编码后的字符串。
8. key : 上级底层tls传输类型的证书密钥文件经过base64编码后的字符串。

## 10.本地认证,限速,控制连接数

proxy的http(s)/socks5/sps代理功能,支持通过配置文件控制用户对代理对访问,支持开启http(s)代理``Proxy Basic 代理认证`,socks5代理认证。

### 开始使用
proxy的http(s)/socks5/sps代理功能可以通过
`--auth-file``--max-conns``--ip-limit``--rate-limit``-a`这五个参数控制。

#### 参数详细解释

##### `--auth-file`
认证的用户名和密码文件,该参数指定一个文件,一行一条规则,格式是:"用户名:密码:连接数:速率:上级"。
`连接数`是用户最大连接数,`速率`是用户每个tcp连接最大速度,单位是:字节/秒,`上级`是用户使用的上级。
不仅可以通过`--auth-file`设置认证用户,也可以直接用`-a`参数设置,多个用户就重复多个`-a`参数即可。
比如:`proxy http -a a:b:0:0: -a c:d:0:0:`

实例解释:
比如:`user:pass:100:10240:http://192.168.1.1:3100`
`user`是认证用户名
`pass`是认证用户密码(不能包含冒号:)
`100`是这个用户的最大连接数,不限制写0
`10240`是这个用户单个tcp连接的速率限制,单位是:字节/秒,不限制写0
`http://192.168.1.1:3100`是这个用户使用的上级,没有就留空

##### `--max-conns`
限制代理服务的全局最大连接数,一个数字,0为不限制,默认0。

##### `--ip-limit`
控制客户端IP的连接数和连接速率,该参数指定一个文件,一行一条规则,#开头的是注视。
示例文件ip.limit,规则格式如下:
`127.0.0.1:100:10240:http://192.168.1.1:3100`
规则解释:
`127.0.0.1`是要限制的IP
`100`是这个IP的最大连接数,不限制写0
`10240`是IP单个tcp连接的速率限制,单位是:字节/s,不限制写0
`http://192.168.1.1:3100`是这个IP使用的上级,没有就留空

##### `--rate-limit`
限制服务的每一个tcp连接的速度,比如:100K 2000K 1M . 0意味着无限制,默认0。

## IP黑白名单

proxy的socks/http(s)/sps/tcp/udp/dns/内网穿透bridge/内网穿透tbridge增加了客户端IP黑白名单。
用--ip-deny参数指定一个客户端IP黑名单列表文件,那么当用户的IP在这个文件里面的时候连接就会被断开。
用--ip-allow参数指定一个客户端IP白名单列表文件,那么当用户的IP不在这个文件里面的时候连接就会被断开。
如果同时设置了--ip-deny和--ip-allow,那么只有--ip-allow会起作用。
10 changes: 5 additions & 5 deletions docs/sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,31 @@
</url>

<url>
<loc>https://snail007.github.io/goproxy/categories/</loc>
<loc>https://snail007.github.io/goproxy/tags/cdn/</loc>
<lastmod>2019-07-05T08:20:48+08:00</lastmod>
<priority>0</priority>
</url>

<url>
<loc>https://snail007.github.io/goproxy/</loc>
<loc>https://snail007.github.io/goproxy/categories/</loc>
<lastmod>2019-07-05T08:20:48+08:00</lastmod>
<priority>0</priority>
</url>

<url>
<loc>https://snail007.github.io/goproxy/posts/</loc>
<loc>https://snail007.github.io/goproxy/</loc>
<lastmod>2019-07-05T08:20:48+08:00</lastmod>
<priority>0</priority>
</url>

<url>
<loc>https://snail007.github.io/goproxy/tags/</loc>
<loc>https://snail007.github.io/goproxy/posts/</loc>
<lastmod>2019-07-05T08:20:48+08:00</lastmod>
<priority>0</priority>
</url>

<url>
<loc>https://snail007.github.io/goproxy/tags/cdn/</loc>
<loc>https://snail007.github.io/goproxy/tags/</loc>
<lastmod>2019-07-05T08:20:48+08:00</lastmod>
<priority>0</priority>
</url>
Expand Down
4 changes: 2 additions & 2 deletions docs/tags/cdn/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/solarized_dark.min.css">
<title>cdn - GOPROXY IN ACTION</title>
<title>CDN - GOPROXY IN ACTION</title>

<link href="https://snail007.github.io/goproxy/css/styles.css" rel="stylesheet">

Expand Down Expand Up @@ -77,7 +77,7 @@


<header class="page-header">
<h1>cdn</h1>
<h1>CDN</h1>
</header>


Expand Down
4 changes: 2 additions & 2 deletions docs/tags/cdn/index.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>cdn on GOPROXY IN ACTION</title>
<title>CDN on GOPROXY IN ACTION</title>
<link>https://snail007.github.io/goproxy/tags/cdn/</link>
<description>Recent content in cdn on GOPROXY IN ACTION</description>
<description>Recent content in CDN on GOPROXY IN ACTION</description>
<generator>Hugo -- gohugo.io</generator>
<language>zh-CN</language>
<lastBuildDate>Fri, 05 Jul 2019 08:20:48 +0800</lastBuildDate>
Expand Down
2 changes: 1 addition & 1 deletion docs/tags/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


<item>
<title>cdn</title>
<title>CDN</title>
<link>https://snail007.github.io/goproxy/tags/cdn/</link>
<pubDate>Fri, 05 Jul 2019 08:20:48 +0800</pubDate>

Expand Down

0 comments on commit ff1b430

Please sign in to comment.