Compare commits

...

34 Commits

Author SHA1 Message Date
zu1k
ac203e945a Merge pull request #7 from hulb/fix
fix type assert and Dockerfile
2020-08-15 17:08:33 +08:00
zu1k
222800134f surge check 2020-08-15 16:42:07 +08:00
zu1k
960b469d9b remove debug code 2020-08-15 15:17:55 +08:00
zu1k
6d947f4fbb add base health check 2020-08-15 15:14:52 +08:00
hulb
ff3f5ae893 fix Dockerfile 2020-08-15 11:43:14 +08:00
hulb
84fc16357e type assert fix 2020-08-15 10:50:50 +08:00
zu1k
cfec56c9b5 update html 2020-08-14 13:18:32 +08:00
zu1k
3ca9e86a29 add type filter 2020-08-14 13:13:11 +08:00
zu1k
a32b2a79bf update html 2020-08-14 12:54:51 +08:00
zu1k
00cc03d6dc update html 2020-08-14 12:03:39 +08:00
zu1k
8cb970c010 update html 2020-08-14 11:19:59 +08:00
zu1k
bc8002e656 add return 2020-08-14 11:08:06 +08:00
zu1k
ce1e4938d2 try to fix obfs-host none 2020-08-14 11:07:30 +08:00
zu1k
d9790fb7c6 fix ws-path 2020-08-14 11:02:26 +08:00
zu1k
01341f2894 ws-path not none 2020-08-14 10:58:32 +08:00
zu1k
36f7fb11b0 fix ss cipher auto 2020-08-14 10:51:58 +08:00
zu1k
a1b46e9fa4 fix vmess wsheader none 2020-08-14 10:46:38 +08:00
zu1k
3c68aafd18 update readme’ 2020-08-14 10:40:09 +08:00
zu1k
5ec8cfcc43 vmess ws-header ignore none 2020-08-14 10:34:43 +08:00
zu1k
272a1c1277 ignore parse ss 2020-08-14 10:32:55 +08:00
zu1k
23bdc67444 checkSurgesupport 2020-08-14 10:30:10 +08:00
zu1k
8f5d76a471 mod assets 2020-08-14 10:27:40 +08:00
zu1k
5222a11d20 try surge list 2020-08-14 10:24:15 +08:00
zu1k
5329a7b545 fix’ 2020-08-14 08:18:56 +08:00
zu1k
180c5b7943 ?? 2020-08-14 08:16:57 +08:00
zu1k
0d30186ea4 fix config file parse err 2020-08-14 08:14:21 +08:00
zu1k
956910881e Merge branch 'master' of github.com:zu1k/proxypool 2020-08-14 08:11:14 +08:00
zu1k
d885b747fa add ss another link support 2020-08-14 08:11:07 +08:00
zu1k
14b8577186 add tg sslist 2020-08-14 07:43:03 +08:00
zu1k
3653819e28 add github link 2020-08-13 21:16:25 +08:00
zu1k
055e1f3db0 update readme 2020-08-13 08:57:42 +08:00
zu1k
15b4ce563c update readme 2020-08-13 08:54:02 +08:00
zu1k
abb65edfb2 add readme 2020-08-13 08:50:09 +08:00
zu1k
cc61798fdf add tgchannel 2020-08-13 08:33:32 +08:00
25 changed files with 736 additions and 58 deletions

View File

@@ -10,5 +10,8 @@ RUN go mod download && \
FROM alpine:latest
RUN apk add --no-cache ca-certificates
COPY --from=builder /proxypool /
ENTRYPOINT ["/proxypool"]
WORKDIR /proxypool-src
COPY ./assets /proxypool-src/assets
COPY ./source.yaml /proxypool-src
COPY --from=builder /proxypool /proxypool-src/
ENTRYPOINT ["/proxypool-src/proxypool"]

76
README.md Normal file
View File

@@ -0,0 +1,76 @@
<h1 align="center">
<br>proxypool<br>
</h1>
<h5 align="center">自动抓取tg频道、订阅地址、公开互联网上的ss、ssr、vmess节点信息聚合去重后提供节点列表</h5>
<p align="center">
<a href="https://github.com/zu1k/proxypool/actions">
<img src="https://img.shields.io/github/workflow/status/zu1k/proxypool/Go?style=flat-square" alt="Github Actions">
</a>
<a href="https://goreportcard.com/report/github.com/zu1k/proxypool">
<img src="https://goreportcard.com/badge/github.com/zu1k/proxypool?style=flat-square">
</a>
<a href="https://github.com/zu1k/proxypool/releases">
<img src="https://img.shields.io/github/release/zu1k/proxypool/all.svg?style=flat-square">
</a>
</p>
## 支持
- 支持ss、ssr、vmess节点链接与订阅
- 任意 Telegram 频道抓取
- 机场订阅地址抓取解析
- 公开互联网页面模糊抓取
- 翻墙党论坛新节点信息
- 其他节点分享网站
- 定时抓取更新
- 使用配置文件提供抓取源
## 安装
### 从源码编译
需要安装Golang
```sh
$ go get -u -v github.com/zu1k/proxypool
```
### 下载预编译程序
从这里下载预编译好的程序 [release](https://github.com/zu1k/proxypool/releases)
### 使用docker
```sh
docker pull docker.pkg.github.com/zu1k/proxypool/proxypool:latest
```
## 使用
### 共享抓取配置文件
每一次抓取前会自动从github下载最新的抓取配置文件
直接运行 `proxypool` 程序即可
### 自定义抓取配置文件
```shell
proxypool -c source.yaml
```
### 帮助更新配置文件
可以在 https://github.com/zu1k/proxypool/issues/3 进行留言
### 用户使用
目前公开版本: https://proxy.tgbot.co
直接在clash添加配置文件即可使用 https://proxy.tgbot.co/clash/config
## 截图
![测速](docs/run.png)

View File

@@ -13,15 +13,36 @@ var router *gin.Engine
func setupRouter() {
router = gin.Default()
router.StaticFile("/clash", "example/clash.html")
router.StaticFile("/clash/config", "example/clash-config.yaml")
router.StaticFile("/", "assets/index.html")
router.StaticFile("/clash", "assets/clash.html")
router.StaticFile("/surge", "assets/surge.html")
router.StaticFile("/clash/config", "assets/clash-config.yaml")
router.StaticFile("/surge/config", "assets/surge.conf")
router.GET("/clash/proxies", func(c *gin.Context) {
text := cache.GetString("clashproxies")
proxyTypes := c.DefaultQuery("type", "")
text := ""
if proxyTypes == "all" || proxyTypes == "" {
text = cache.GetString("clashproxies")
if text == "" {
proxies := cache.GetProxies()
clash := provider.Clash{Proxies: proxies}
text = clash.Provide()
cache.SetString("clashproxies", text)
}
} else {
proxies := cache.GetProxies()
clash := provider.Clash{Proxies: proxies, Types: proxyTypes}
text = clash.Provide()
}
c.String(200, text)
})
router.GET("/surge/proxies", func(c *gin.Context) {
text := cache.GetString("surgeproxies")
if text == "" {
proxies := cache.GetProxies()
clash := provider.Clash{Proxies: proxies}
text = clash.Provide()
cache.SetString("clashproxies", text)
surge := provider.Surge{Proxies: proxies}
text = surge.Provide()
cache.SetString("surgeproxies", text)
}
c.String(200, text)
})

View File

@@ -5,10 +5,14 @@ import (
"io/ioutil"
"log"
"math/rand"
"os"
"strconv"
"sync"
"github.com/zu1k/proxypool/checker"
"github.com/zu1k/proxypool/config"
"gopkg.in/yaml.v2"
"github.com/zu1k/proxypool/app/cache"
"github.com/zu1k/proxypool/provider"
"github.com/zu1k/proxypool/proxy"
@@ -35,6 +39,7 @@ func Crawl() {
log.Println("Crawl node count:", num)
cache.SetProxies(proxies)
cache.SetString("clashproxies", provider.Clash{Proxies: proxies}.Provide())
cache.SetString("surgeproxies", provider.Surge{Proxies: proxies}.Provide())
}
func CrawlGo() {
@@ -63,9 +68,14 @@ func CrawlGo() {
for i := 0; i < num; i++ {
proxies[i].SetName(strconv.Itoa(rand.Int()))
}
log.Println("CrawlGo node count:", num)
cache.SetProxies(proxies)
proxies = checker.CleanProxies(provider.Clash{Proxies: proxies}.CleanProxies())
log.Println("CrawlGo clash useable node count:", len(proxies))
cache.SetString("clashproxies", provider.Clash{Proxies: proxies}.Provide())
cache.SetString("surgeproxies", provider.Surge{Proxies: proxies}.Provide())
}
func FetchNewConfigFileThenInit() {
@@ -76,12 +86,10 @@ func FetchNewConfigFileThenInit() {
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
err = yaml.Unmarshal(body, &config.SourceConfig)
if err != nil {
return
}
err = ioutil.WriteFile("source.yaml", body, os.ModePerm)
if err != nil {
return
}
InitConfigAndGetters("source.yaml")
InitGetters(config.SourceConfig.Sources)
}

View File

@@ -1,3 +1,6 @@
# 所有节点均从公开互联网上抓取使用clash自动检查可用性即可
# 抓取程序已开源: https://github.com/zu1k/proxypool
# port of HTTP
port: 7890

118
assets/clash.html Normal file
View File

@@ -0,0 +1,118 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="HandheldFriendly" content="True">
<title>免费Clash节点</title>
<style type='text/css'>
body {
background-color: white;
color: #333333;
font-family: Arial, sans-serif;
margin: 0;
padding: 36px;
line-height: 1;
font-size: 14px;
}
.section {
margin-bottom: 36px;
}
.section.friendly {
color: #222222;
}
.section.friendly h1 {
font-size: 26px;
background-color: #dad8e4;
padding: 18px 22px 15px 22px;
margin: 0;
overflow: hidden;
}
.section.friendly h1 strong {
display: inline-block;
float: left;
}
.section.friendly h1 small {
display: inline-block;
float: right;
text-align: right;
font-size: 18px;
padding-top: 4px;
color: #333333;
}
.section.friendly .article {
border: 4px solid #dad8e4;
padding: 24px 18px 18px 18px;
}
.section.friendly .article h3 {
font-size: 20px;
margin: 0 0 18px 0;
}
.section.friendly .article a {
color: #6b6ceb;
}
.section.friendly .article a:visited {
color: #1d1d3b;
}
.section.friendly .article p {
font-size: 14px;
}
.section.friendly .article ul {
list-style-type: square;
}
.section.original {
background-color: #eeeeee;
color: #444444;
}
.section.original h2 {
background-color: #dddddd;
margin: 0;
padding: 18px 22px 18px 22px;
font-size: 20px;
}
.section.original pre {
margin: 0;
padding: 18px 22px 18px 22px;
overflow: auto;
font-family: monaco, monospaced;
}
.section.original pre code {
display: block;
font-size: 11px;
width: 100%;
}
</style>
</head>
<body>
<div class='container'>
<div class='section friendly'>
<h1><strong>免费Clash节点</strong></h1>
<div class='article'>
<p>自动抓取tg频道、订阅地址、公开互联网上的ss、ssr、vmess节点信息聚合去重后提供clash配置每10分钟更新</p>
<br>
<p>Clash配置文件<a href="https://proxy.tgbot.co/clash/config">https://proxy.tgbot.co/clash/config</a> <a href="clash://install-config?url=https://proxy.tgbot.co/clash/config">一键导入</a></p>
<p>Clash proxy-provider(Shadowrocket添加订阅方式可用)<a href="https://proxy.tgbot.co/clash/proxies">https://proxy.tgbot.co/clash/proxies</a></p>
<br>
<p>筛选代理类型(此种方式你只能自己维护配置文件)https://proxy.tgbot.co/clash/proxies?type=ss,ssr,vmess</p>
<br>
<p>抓取程序已开源:<a href="https://github.com/zu1k/proxypool">https://github.com/zu1k/proxypool</a></p>
</div>
</div>
</div>
</body>
</html>

89
assets/index.html Normal file
View File

@@ -0,0 +1,89 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="HandheldFriendly" content="True">
<title>免费节点</title>
<style type='text/css'>
body {
background-color: white;
color: #333333;
font-family: Arial, sans-serif;
margin: 0;
padding: 36px;
line-height: 1;
font-size: 14px; }
.section {
margin-bottom: 36px; }
.section.friendly {
color: #222222; }
.section.friendly h1 {
font-size: 26px;
background-color: #dad8e4;
padding: 18px 22px 15px 22px;
margin: 0;
overflow: hidden; }
.section.friendly h1 strong {
display: inline-block;
float: left; }
.section.friendly h1 small {
display: inline-block;
float: right;
text-align: right;
font-size: 18px;
padding-top: 4px;
color: #333333; }
.section.friendly .article {
border: 4px solid #dad8e4;
padding: 24px 18px 18px 18px; }
.section.friendly .article h3 {
font-size: 20px;
margin: 0 0 18px 0; }
.section.friendly .article a {
color: #6b6ceb; }
.section.friendly .article a:visited {
color: #1d1d3b; }
.section.friendly .article p {
font-size: 14px; }
.section.friendly .article ul {
list-style-type: square; }
.section.original {
background-color: #eeeeee;
color: #444444; }
.section.original h2 {
background-color: #dddddd;
margin: 0;
padding: 18px 22px 18px 22px;
font-size: 20px; }
.section.original pre {
margin: 0;
padding: 18px 22px 18px 22px;
overflow: auto;
font-family: monaco, monospaced; }
.section.original pre code {
display: block;
font-size: 11px;
width: 100%; }
</style>
</head>
<body>
<div class='container'>
<div class='section friendly'>
<h1><strong>免费节点</strong></h1>
<div class='article'>
<p>自动抓取tg频道、订阅地址、公开互联网上的ss、ssr、vmess节点信息聚合去重后提供节点列表每10分钟更新</p>
<br>
<p>Clash配置文件<a href="https://proxy.tgbot.co/clash/config">https://proxy.tgbot.co/clash/config</a> <a href="clash://install-config?url=https://proxy.tgbot.co/clash/config">一键导入</a></p>
<p>Clash proxy-provider(Shadowrocket添加订阅方式可用)<a href="https://proxy.tgbot.co/clash/proxies">https://proxy.tgbot.co/clash/proxies</a></p>
<br>
<p>Surge配置文件<a href="https://proxy.tgbot.co/surge/config">https://proxy.tgbot.co/surge/config</a> <a href="surge3:///install-config?url=https://proxy.tgbot.co/surge/config">一键导入</a></p>
<p>Surge proxy list<a href="https://proxy.tgbot.co/surge/proxies">https://proxy.tgbot.co/surge/proxies</a></p>
<br>
<p>抓取程序已开源:<a href="https://github.com/zu1k/proxypool">https://github.com/zu1k/proxypool</a></p>
</div>
</div>
</div>
</body>
</html>

45
assets/surge.conf Normal file
View File

@@ -0,0 +1,45 @@
[Proxy]
Direct = direct
[Proxy Group]
Proxy = select, 延迟最低, 失败切换, 手动选择
延迟最低 = url-test, policy-path=https://proxy.tgbot.co/surge/proxies, url=http://www.qualcomm.cn/generate_204, update-interval=3600, interval = 600s, tolerance = 100ms, timeout = 5s, evaluate-before-use = true
失败切换 = fallback, policy-path=https://proxy.tgbot.co/surge/proxies, url=http://www.qualcomm.cn/generate_204, update-interval=3600, interval = 600s, tolerance = 100ms, timeout = 5s, evaluate-before-use = true
手动选择 = select, policy-path=https://proxy.tgbot.co/surge/proxies, url=http://www.qualcomm.cn/generate_204, update-interval=3600, interval = 600s, tolerance = 100ms, timeout = 5s, evaluate-before-use = true
Apple = select, Direct, Proxy
Adblock = select, Direct, REJECT, REJECT-TINYGIF
[Rule]
# RULESET
RULE-SET,SYSTEM,Direct
#
# Unbreak 后续规则修正
RULE-SET,https://github.com/DivineEngine/Profiles/raw/master/Surge/Ruleset/Unbreak.list,Adblock
# Advertising 广告
RULE-SET,https://github.com/DivineEngine/Profiles/raw/master/Surge/Ruleset/Guard/Advertising.list,Adblock
# Privacy 隐私
# RULE-SET,https://github.com/DivineEngine/Profiles/raw/master/Surge/Ruleset/Guard/Privacy.list,Adblock
# Hijacking 运营商劫持或恶意网站
RULE-SET,https://github.com/DivineEngine/Profiles/raw/master/Surge/Ruleset/Guard/Hijacking.list,Adblock
#
# Apple
RULE-SET,https://github.com/DivineEngine/Profiles/raw/master/Surge/Ruleset/Extra/Apple/Apple.list,Apple
#
# 代理
# Streaming 国际流媒体服务
RULE-SET,https://github.com/DivineEngine/Profiles/raw/master/Surge/Ruleset/StreamingMedia/Streaming.list,Proxy
# StreamingSE 中国流媒体服务(面向海外版本)
RULE-SET,https://github.com/DivineEngine/Profiles/raw/master/Surge/Ruleset/StreamingMedia/StreamingSE.list,Proxy
# Global 全球加速
RULE-SET,https://github.com/DivineEngine/Profiles/raw/master/Surge/Ruleset/Global.list,Proxy
#
RULE-SET,https://github.com/Hackl0us/SS-Rule-Snippet/raw/master/Rulesets/App/social/Telegram.list,Proxy
RULE-SET,https://github.com/Hackl0us/SS-Rule-Snippet/raw/master/Rulesets/App/social/WhatsApp.list,Proxy
RULE-SET,https://github.com/Hackl0us/SS-Rule-Snippet/raw/master/Rulesets/App/social/LINE.list,Proxy
#
# Direct
RULE-SET,https://github.com/DivineEngine/Profiles/raw/master/Surge/Ruleset/Extra/ChinaIP.list,Direct
#
RULE-SET,LAN,Direct
# GEOIP,CN,Direct
FINAL,Proxy,dns-failed

View File

@@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="HandheldFriendly" content="True">
<title>免费Clash节点</title>
<title>免费Surge节点</title>
<style type='text/css'>
body {
background-color: white;
@@ -71,11 +71,14 @@
<body>
<div class='container'>
<div class='section friendly'>
<h1><strong>免费Clash节点</strong></h1>
<h1><strong>免费Surge节点</strong></h1>
<div class='article'>
<p>所有节点均从公开互联网上爬取每10分钟自动更新</p>
<p>Clash配置文件<a href="https://proxy.tgbot.co/clash/config">https://proxy.tgbot.co/clash/config</a></p>
<p>Clash proxy-provider<a href="https://proxy.tgbot.co/clash/proxies">https://proxy.tgbot.co/clash/proxies</a></p>
<p>自动抓取tg频道、订阅地址、公开互联网上的ss、vmess节点信息聚合去重后提供Surge节点列表每10分钟更新</p>
<br>
<p>Surge配置文件<a href="https://proxy.tgbot.co/surge/config">https://proxy.tgbot.co/surge/config</a> <a href="surge3:///install-config?url=https://proxy.tgbot.co/surge/config">一键导入</a></p>
<p>Surge proxy list<a href="https://proxy.tgbot.co/surge/proxies">https://proxy.tgbot.co/surge/proxies</a></p>
<br>
<p>抓取程序已开源:<a href="https://github.com/zu1k/proxypool">https://github.com/zu1k/proxypool</a></p>
</div>
</div>
</div>

77
checker/check.go Normal file
View File

@@ -0,0 +1,77 @@
package checker
import (
"context"
"encoding/json"
"fmt"
"time"
"github.com/Dreamacro/clash/adapters/outbound"
"github.com/zu1k/proxypool/proxy"
)
const defaultURLTestTimeout = time.Second * 15
func Check(p proxy.Proxy) (delay uint16, err error) {
pmap := make(map[string]interface{})
err = json.Unmarshal([]byte(p.String()), &pmap)
if err != nil {
return
}
pmap["port"] = int(pmap["port"].(float64))
if p.Type() == "vmess" {
pmap["alterId"] = int(pmap["alterId"].(float64))
}
clashProxy, err := outbound.ParseProxy(pmap)
if err != nil {
fmt.Println(err.Error())
return
}
ctx, cancel := context.WithTimeout(context.Background(), defaultURLTestTimeout)
delay, err = clashProxy.URLTest(ctx, "http://www.gstatic.com/generate_204")
cancel()
return delay, err
}
func CleanProxies(proxies []proxy.Proxy) (cproxies []proxy.Proxy) {
c := make(chan checkResult, 40)
for _, p := range proxies {
go checkProxyWithChan(p, c)
}
okMap := make(map[string]struct{})
size := len(proxies)
for i := 0; i < size; i++ {
r := <-c
if r.delay > 0 {
okMap[r.name] = struct{}{}
}
}
cproxies = make([]proxy.Proxy, 0)
for _, p := range proxies {
if _, ok := okMap[p.Identifier()]; ok {
cproxies = append(cproxies, p)
}
}
return
}
type checkResult struct {
name string
delay uint16
}
func checkProxyWithChan(p proxy.Proxy, c chan checkResult) {
delay, err := Check(p)
if err != nil {
c <- checkResult{
name: p.Identifier(),
delay: 0,
}
}
c <- checkResult{
name: p.Identifier(),
delay: delay,
}
}

BIN
docs/run.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 KiB

View File

@@ -22,14 +22,22 @@ type TGChannelGetter struct {
func NewTGChannelGetter(options tool.Options) Getter {
num, found := options["num"]
if !found || int(num.(float64)) <= 0 {
num = 200
t := 200
switch num.(type) {
case int:
t = num.(int)
case float64:
t = int(num.(float64))
}
if !found || t <= 0 {
t = 200
}
url, found := options["channel"]
if found {
return &TGChannelGetter{
c: colly.NewCollector(),
NumNeeded: int(num.(float64)),
NumNeeded: t,
Url: "https://t.me/s/" + url.(string),
}
}

View File

@@ -22,14 +22,23 @@ type WebFanqiangdang struct {
func NewWebFanqiangdangGetter(options tool.Options) Getter {
num, found := options["num"]
if !found || int(num.(float64)) <= 0 {
num = 200
t := 200
switch num.(type) {
case int:
t = num.(int)
case float64:
t = int(num.(float64))
}
if !found || t <= 0 {
t = 200
}
url, found := options["url"]
if found {
return &WebFanqiangdang{
c: colly.NewCollector(),
NumNeeded: int(num.(float64)),
NumNeeded: t,
Url: url.(string),
}
}

12
go.mod
View File

@@ -3,6 +3,7 @@ module github.com/zu1k/proxypool
go 1.14
require (
github.com/Dreamacro/clash v1.0.1-0.20200812125056-8b7c731fd629
github.com/PuerkitoBio/goquery v1.5.1 // indirect
github.com/andybalholm/cascadia v1.2.0 // indirect
github.com/antchfx/htmlquery v1.2.3 // indirect
@@ -18,18 +19,21 @@ require (
github.com/json-iterator/go v1.1.10 // indirect
github.com/kennygrant/sanitize v1.2.4 // indirect
github.com/kr/pretty v0.1.0 // indirect
github.com/miekg/dns v1.1.31 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/oschwald/maxminddb-golang v1.7.0 // indirect
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca // indirect
github.com/spf13/cobra v1.0.0 // indirect
github.com/spf13/viper v1.7.1 // indirect
github.com/stretchr/testify v1.5.1 // indirect
github.com/temoto/robotstxt v1.1.1 // indirect
golang.org/x/net v0.0.0-20200625001655-4c5254603344 // indirect
golang.org/x/sys v0.0.0-20200810151505-1b9f1253b3ed // indirect
golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de // indirect
golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc // indirect
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 // indirect
golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed // indirect
google.golang.org/appengine v1.6.6 // indirect
google.golang.org/protobuf v1.25.0 // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/yaml.v2 v2.3.0 // indirect
gopkg.in/yaml.v2 v2.3.0
)

56
go.sum
View File

@@ -13,6 +13,10 @@ cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiy
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/Dreamacro/clash v1.0.1-0.20200812125056-8b7c731fd629 h1:876g402+S9ROmgHU7wGdSssWz/TNiJJsDsphd2qsbRc=
github.com/Dreamacro/clash v1.0.1-0.20200812125056-8b7c731fd629/go.mod h1:LMbDBvj4kuiE5TGhZ8JxhEdRpBtZRjQllo2r7RfUw1c=
github.com/Dreamacro/go-shadowsocks2 v0.1.6-0.20200722122336-8e5c7db4f96a h1:JhQFrFOkCpRB8qsN6PrzHFzjy/8iQpFFk5cbOiplh6s=
github.com/Dreamacro/go-shadowsocks2 v0.1.6-0.20200722122336-8e5c7db4f96a/go.mod h1:LSXCjyHesPY3pLjhwff1mQX72ItcBT/N2xNC685cYeU=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/PuerkitoBio/goquery v1.5.1 h1:PSPBGne8NIUWw+/7vFBV+kG2J/5MOjbzc7154OaKCSE=
github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc=
@@ -52,6 +56,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc=
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
@@ -63,6 +69,12 @@ github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14=
github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M=
github.com/go-chi/chi v4.1.2+incompatible h1:fGFk2Gmi/YKXk0OmGfBh0WgmN3XB8lVnEyNz34tQRec=
github.com/go-chi/chi v4.1.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ=
github.com/go-chi/cors v1.1.1 h1:eHuqxsIw89iXcWnWUN8R72JMibABJTN/4IOYI5WERvw=
github.com/go-chi/cors v1.1.1/go.mod h1:K2Yje0VW/SJzxiyMYu6iPQYa7hMjQX2i/F491VChg1I=
github.com/go-chi/render v1.0.1 h1:4/5tis2cKaNdnv9zFLfXzcquC9HbeZgCnxGnKrltBS8=
github.com/go-chi/render v1.0.1/go.mod h1:pq4Rr7HbnsdaeHagklXub+p6Wd16Af5l9koip1OvJns=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
@@ -83,6 +95,8 @@ github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
github.com/gocolly/colly v1.2.0 h1:qRz9YAn8FIH0qzgNUw+HT9UN7wm1oF9OBAilwEWpyrI=
github.com/gocolly/colly v1.2.0/go.mod h1:Hof5T3ZswNVsOHYmba1u03W65HDWgpV5HifSuueE0EA=
github.com/gofrs/uuid v3.3.0+incompatible h1:8K4tyRfvU1CYPgJsveYFQMhpFd/wXNM7iK6rR7UHz84=
github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
@@ -121,6 +135,7 @@ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
@@ -165,6 +180,8 @@ github.com/kennygrant/sanitize v1.2.4/go.mod h1:LGsjYYtgxbetdg5owWB2mpgUL6e2nfw2
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8=
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
@@ -182,6 +199,10 @@ github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHX
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
github.com/miekg/dns v1.1.29 h1:xHBEhR+t5RzcFJjBLJlax2daXOrTYtr9z4WdKEfWFzg=
github.com/miekg/dns v1.1.29/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM=
github.com/miekg/dns v1.1.31 h1:sJFOl9BgwbYAWOGEwr61FU28pqsBNdpRBnhGXtO06Oo=
github.com/miekg/dns v1.1.31/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM=
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
@@ -205,6 +226,12 @@ github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/oschwald/geoip2-golang v1.4.0 h1:5RlrjCgRyIGDz/mBmPfnAF4h8k0IAcRv9PvrpOfz+Ug=
github.com/oschwald/geoip2-golang v1.4.0/go.mod h1:8QwxJvRImBH+Zl6Aa6MaIcs5YdlZSTKtzmPGzQqi9ng=
github.com/oschwald/maxminddb-golang v1.6.0 h1:KAJSjdHQ8Kv45nFIbtoLGrGWqHFajOIm7skTyz/+Dls=
github.com/oschwald/maxminddb-golang v1.6.0/go.mod h1:DUJFucBg2cvqx42YmDa/+xHvb0elJtOm3o4aFQ/nb/w=
github.com/oschwald/maxminddb-golang v1.7.0 h1:JmU4Q1WBv5Q+2KZy5xJI+98aUwTIrPPxZUkd5Cwr8Zc=
github.com/oschwald/maxminddb-golang v1.7.0/go.mod h1:RXZtst0N6+FY/3qCNmZMBApR19cdQj43/NM9VkrNAis=
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=
github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
@@ -234,6 +261,8 @@ github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca/go.mod h1:uugorj
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I=
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
@@ -258,6 +287,7 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/temoto/robotstxt v1.1.1 h1:Gh8RCs8ouX3hRSxxK7B1mO5RFByQ4CmJZDwgom++JaA=
@@ -281,7 +311,13 @@ golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnf
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de h1:ikNHVSjEfnvz6sxdSPCaPt572qowuyMDMJLLm3Db3ig=
golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@@ -300,6 +336,7 @@ golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -317,11 +354,15 @@ golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200625001655-4c5254603344 h1:vGXIOMxbNfDTk/aXCmfdLgkrSV+Z2tcbze+pEc3v5W4=
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc h1:zK/HqS5bZxDptfPJNq8v7vJfXtkU7r9TLIoSr1bXaP4=
golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -331,6 +372,10 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a h1:WXEvlFVvvGxCJLG6REjsT03iWnKLEWinaScsxF2Vm2o=
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 h1:qwRHBd0NqMbJxfbotnDhm2ByMI1Shq4Y6oRJo21SGJA=
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -341,15 +386,20 @@ golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5h
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191224085550-c709ea063b76/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200810151505-1b9f1253b3ed h1:WBkVNH1zd9jg/dK4HCM4lNANnmd12EHC9z+LmcCG4ns=
golang.org/x/sys v0.0.0-20200810151505-1b9f1253b3ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed h1:J22ig1FUekjjkmZUM7pTKixYm8DvrYsvrBZdunYeIuQ=
golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
@@ -374,7 +424,9 @@ golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtn
golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
@@ -397,6 +449,7 @@ google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
@@ -419,6 +472,8 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/eapache/channels.v1 v1.1.0 h1:5bGAyKKvyCTWjSj7mhefG6Lc68VyN4MH1v8/7OoeeB4=
gopkg.in/eapache/channels.v1 v1.1.0/go.mod h1:BHIBujSvu9yMTrTYbTCjDD43gUhtmaOtTWDe7sTv1js=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno=
@@ -432,6 +487,7 @@ gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=

View File

@@ -19,5 +19,6 @@ func main() {
go app.Cron()
fmt.Println("Do the first crawl...")
app.CrawlGo()
api.Run()
}

View File

@@ -3,3 +3,12 @@ package provider
type Provider interface {
Provide() string
}
func checkInList(list []string, item string) bool {
for _, i := range list {
if item == i {
return true
}
}
return false
}

View File

@@ -8,15 +8,39 @@ import (
type Clash struct {
Proxies []proxy.Proxy `yaml:"proxies"`
Types string `yaml:"type"`
}
func (c Clash) CleanProxies() (proxies []proxy.Proxy) {
proxies = make([]proxy.Proxy, 0)
for _, p := range c.Proxies {
if checkClashSupport(p) {
proxies = append(proxies, p)
}
}
return
}
func (c Clash) Provide() string {
var resultBuilder strings.Builder
resultBuilder.WriteString("proxies:\n")
for _, p := range c.Proxies {
if checkClashSupport(p) {
resultBuilder.WriteString(p.ToClash() + "\n")
if c.Types == "" || c.Types == "all" {
for _, p := range c.Proxies {
if checkClashSupport(p) {
resultBuilder.WriteString(p.ToClash() + "\n")
}
}
} else {
types := strings.Split(c.Types, ",")
for _, p := range c.Proxies {
if checkClashSupport(p) {
for _, t := range types {
if p.Type() == t {
resultBuilder.WriteString(p.ToClash() + "\n")
}
}
}
}
}
@@ -24,18 +48,18 @@ func (c Clash) Provide() string {
}
func checkClashSupport(p proxy.Proxy) bool {
switch p.(type) {
case *proxy.ShadowsocksR:
switch p.Type() {
case "ssr":
ssr := p.(*proxy.ShadowsocksR)
if checkInList(ssrCipherList, ssr.Cipher) && checkInList(ssrProtocolList, ssr.Protocol) && checkInList(ssrObfsList, ssr.Obfs) {
return true
}
case *proxy.Vmess:
case "vmess":
vmess := p.(*proxy.Vmess)
if checkInList(vmessCipherList, vmess.Cipher) {
return true
}
case *proxy.Shadowsocks:
case "ss":
ss := p.(*proxy.Shadowsocks)
if checkInList(ssCipherList, ss.Cipher) {
return true
@@ -46,15 +70,6 @@ func checkClashSupport(p proxy.Proxy) bool {
return false
}
func checkInList(list []string, item string) bool {
for _, i := range list {
if item == i {
return true
}
}
return false
}
var ssrCipherList = []string{
"aes-128-cfb",
"aes-192-cfb",

40
provider/surge.go Normal file
View File

@@ -0,0 +1,40 @@
package provider
import (
"strings"
"github.com/zu1k/proxypool/proxy"
)
type Surge struct {
Proxies []proxy.Proxy `yaml:"proxies"`
}
func (s Surge) Provide() string {
var resultBuilder strings.Builder
for _, p := range s.Proxies {
if checkSurgeSupport(p) {
resultBuilder.WriteString(p.ToSurge() + "\n")
}
}
return resultBuilder.String()
}
func checkSurgeSupport(p proxy.Proxy) bool {
switch p.(type) {
case *proxy.ShadowsocksR:
return false
case *proxy.Vmess:
return true
case *proxy.Shadowsocks:
ss := p.(*proxy.Shadowsocks)
if checkInList(ssCipherList, ss.Cipher) {
return true
}
default:
return false
}
return false
}

View File

@@ -11,8 +11,10 @@ type Base struct {
type Proxy interface {
String() string
ToClash() string
ToSurge() string
Identifier() string
SetName(name string)
Type() string
}
func Deduplication(src []Proxy) []Proxy {

View File

@@ -3,6 +3,7 @@ package proxy
import (
"encoding/json"
"errors"
"fmt"
"math/rand"
"net"
"net/url"
@@ -45,10 +46,29 @@ func (ss Shadowsocks) ToClash() string {
return "- " + string(data)
}
func (ss Shadowsocks) ToSurge() string {
// node1 = ss, server, port, encrypt-method=, password=, obfs=, obfs-host=, udp-relay=false
if ss.Plugin == "obfs" {
text := fmt.Sprintf("%s = ss, %s, %d, encrypt-method=%s, password=%s, obfs=%s, udp-relay=false",
ss.Name, ss.Server, ss.Port, ss.Cipher, ss.Password, ss.PluginOpts["mode"])
if ss.PluginOpts["host"].(string) != "" {
text += ", obfs-host=" + ss.PluginOpts["host"].(string)
}
return text
} else {
return fmt.Sprintf("%s = ss, %s, %d, encrypt-method=%s, password=%s, udp-relay=false",
ss.Name, ss.Server, ss.Port, ss.Cipher, ss.Password)
}
}
func (ss *Shadowsocks) SetName(name string) {
ss.Name = name
}
func (ss *Shadowsocks) Type() string {
return "ss"
}
func ParseSSLink(link string) (*Shadowsocks, error) {
if !strings.HasPrefix(link, "ss://") {
return nil, ErrorNotSSRLink
@@ -59,20 +79,35 @@ func ParseSSLink(link string) (*Shadowsocks, error) {
return nil, ErrorNotSSLink
}
cipher := ""
password := ""
if uri.User.String() == "" {
// base64的情况
infos, err := tool.Base64DecodeString(uri.Hostname())
if err != nil {
return nil, err
}
uri, err = url.Parse("ss://" + infos)
if err != nil {
return nil, err
}
cipher = uri.User.Username()
password, _ = uri.User.Password()
} else {
cipherInfoString, err := tool.Base64DecodeString(uri.User.Username())
if err != nil {
return nil, ErrorPasswordParseFail
}
cipherInfo := strings.SplitN(cipherInfoString, ":", 2)
if len(cipherInfo) < 2 {
return nil, ErrorPasswordParseFail
}
cipher = strings.ToLower(cipherInfo[0])
password = cipherInfo[1]
}
server := uri.Hostname()
port, _ := strconv.Atoi(uri.Port())
cipherInfoString, err := tool.Base64DecodeString(uri.User.Username())
if err != nil {
return nil, ErrorPasswordParseFail
}
cipherInfo := strings.SplitN(cipherInfoString, ":", 2)
if len(cipherInfo) < 2 {
return nil, ErrorPasswordParseFail
}
cipher := strings.ToLower(cipherInfo[0])
password := cipherInfo[1]
moreInfos := uri.Query()
pluginString := moreInfos.Get("plugin")
plugin := ""
@@ -92,6 +127,9 @@ func ParseSSLink(link string) (*Shadowsocks, error) {
}
}
}
if port == 0 || cipher == "" {
return nil, ErrorNotSSLink
}
return &Shadowsocks{
Base: Base{

View File

@@ -53,10 +53,18 @@ func (ssr ShadowsocksR) ToClash() string {
return "- " + string(data)
}
func (ssr ShadowsocksR) ToSurge() string {
return ""
}
func (ssr *ShadowsocksR) SetName(name string) {
ssr.Name = name
}
func (ssr *ShadowsocksR) Type() string {
return "ssr"
}
func ParseSSRLink(link string) (*ShadowsocksR, error) {
if !strings.HasPrefix(link, "ssr") {
return nil, ErrorNotSSRLink

View File

@@ -3,6 +3,7 @@ package proxy
import (
"encoding/json"
"errors"
"fmt"
"math/rand"
"net"
"net/url"
@@ -58,10 +59,37 @@ func (v Vmess) ToClash() string {
return "- " + string(data)
}
func (v Vmess) ToSurge() string {
// node2 = vmess, server, port, username=, ws=true, ws-path=, ws-headers=
if v.Network == "ws" {
wsHeasers := ""
for k, v := range v.WSHeaders {
if wsHeasers == "" {
wsHeasers = k + ":" + v
} else {
wsHeasers += "|" + k + ":" + v
}
}
text := fmt.Sprintf("%s = vmess, %s, %d, username=%s, ws=true, tls=%t, ws-path=%s",
v.Name, v.Server, v.Port, v.UUID, v.TLS, v.WSPath)
if wsHeasers != "" {
text += ", ws-headers=" + wsHeasers
}
return text
} else {
return fmt.Sprintf("%s = vmess, %s, %d, username=%s, tls=%t",
v.Name, v.Server, v.Port, v.UUID, v.TLS)
}
}
func (v *Vmess) SetName(name string) {
v.Name = name
}
func (v *Vmess) Type() string {
return "vmess"
}
type vmessLinkJson struct {
Add string `json:"add"`
V string `json:"v"`
@@ -129,6 +157,9 @@ func ParseVmessLink(link string) (*Vmess, error) {
}
//obfsParam := moreInfo.Get("obfsParam")
path := moreInfo.Get("path")
if path == "" {
path = "/"
}
tls := moreInfo.Get("tls") == "1"
wsHeaders := make(map[string]string)
@@ -176,8 +207,13 @@ func ParseVmessLink(link string) (*Vmess, error) {
tls := vmessJson.Tls == "tls"
wsHeaders := make(map[string]string)
wsHeaders["HOST"] = vmessJson.Host
if vmessJson.Host != "" {
wsHeaders["HOST"] = vmessJson.Host
}
if vmessJson.Path == "" {
vmessJson.Path = "/"
}
return &Vmess{
Base: Base{
Name: vmessJson.Ps + "_" + strconv.Itoa(rand.Int()),

View File

@@ -202,6 +202,10 @@ sources:
options:
channel: ssrList
num: 200
- type: tgchannel
options:
channel: ssList
num: 200
- type: tgchannel
options:
@@ -248,6 +252,11 @@ sources:
channel: fanqiang666
num: 200
- type: tgchannel
options:
channel: jiedianfenxiang
num: 200
- type: web-fanqiangdang
options:
url: https://fanqiangdang.com/forum.php?mod=rss&fid=50&auth=0