Compare commits
96 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a7a8a9ff8b | ||
|
|
a9fa94c8c1 | ||
|
|
4cfb143f88 | ||
|
|
3fbdb91e7d | ||
|
|
6b462f6310 | ||
|
|
32c1c7c127 | ||
|
|
be46f914de | ||
|
|
89338d7152 | ||
|
|
1fee5e87ff | ||
|
|
2ba481e388 | ||
|
|
daea47552d | ||
|
|
59ea871190 | ||
|
|
ef44ef7436 | ||
|
|
f1ec6c6bf8 | ||
|
|
e91c024e7b | ||
|
|
32dadde123 | ||
|
|
573f8cb312 | ||
|
|
67457a5a9e | ||
|
|
b61dd2d8ec | ||
|
|
c0ee23cb98 | ||
|
|
f3c3397844 | ||
|
|
8b2b109ca9 | ||
|
|
b2b7c94b68 | ||
|
|
119873e704 | ||
|
|
4fd88553ba | ||
|
|
12da2a73d6 | ||
|
|
a29d02c88e | ||
|
|
7d0cac882c | ||
|
|
36d199a200 | ||
|
|
7b74ed4419 | ||
|
|
892ba586ed | ||
|
|
151184389a | ||
|
|
23a337e845 | ||
|
|
b1b82b5d4e | ||
|
|
e13892a984 | ||
|
|
95fa5a72c6 | ||
|
|
996c1d7cf3 | ||
|
|
30a9cae5aa | ||
|
|
8ca9893650 | ||
|
|
d7aa135666 | ||
|
|
e4b97202cd | ||
|
|
b0b72c19c9 | ||
|
|
ac203e945a | ||
|
|
222800134f | ||
|
|
960b469d9b | ||
|
|
6d947f4fbb | ||
|
|
ff3f5ae893 | ||
|
|
84fc16357e | ||
|
|
cfec56c9b5 | ||
|
|
3ca9e86a29 | ||
|
|
a32b2a79bf | ||
|
|
00cc03d6dc | ||
|
|
8cb970c010 | ||
|
|
bc8002e656 | ||
|
|
ce1e4938d2 | ||
|
|
d9790fb7c6 | ||
|
|
01341f2894 | ||
|
|
36f7fb11b0 | ||
|
|
a1b46e9fa4 | ||
|
|
3c68aafd18 | ||
|
|
5ec8cfcc43 | ||
|
|
272a1c1277 | ||
|
|
23bdc67444 | ||
|
|
8f5d76a471 | ||
|
|
5222a11d20 | ||
|
|
5329a7b545 | ||
|
|
180c5b7943 | ||
|
|
0d30186ea4 | ||
|
|
956910881e | ||
|
|
d885b747fa | ||
|
|
14b8577186 | ||
|
|
3653819e28 | ||
|
|
055e1f3db0 | ||
|
|
15b4ce563c | ||
|
|
abb65edfb2 | ||
|
|
cc61798fdf | ||
|
|
1a6ad785e6 | ||
|
|
7db05c31d0 | ||
|
|
8a2181f822 | ||
|
|
f0cc329db2 | ||
|
|
ab9c13d852 | ||
|
|
88469325bd | ||
|
|
b16e1d6b89 | ||
|
|
d12a581575 | ||
|
|
8f510c21fe | ||
|
|
21f55ac81d | ||
|
|
c87b5872e2 | ||
|
|
304de88e96 | ||
|
|
db47de2747 | ||
|
|
e6c935f13f | ||
|
|
a96d21f4c7 | ||
|
|
c7f1dc8830 | ||
|
|
b35e73cbd4 | ||
|
|
1d890b0257 | ||
|
|
4ba0f7337a | ||
|
|
3127fe6e2c |
2
.github/workflows/go.yml
vendored
2
.github/workflows/go.yml
vendored
@@ -43,7 +43,7 @@ jobs:
|
||||
draft: true
|
||||
prerelease: true
|
||||
|
||||
- uses: actions/upload-artifact@v2.1.3
|
||||
- uses: actions/upload-artifact@v2.1.4
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
name: build
|
||||
|
||||
@@ -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"]
|
||||
|
||||
87
README.md
Normal file
87
README.md
Normal file
@@ -0,0 +1,87 @@
|
||||
<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>
|
||||
|
||||
 来都来了,不点个Star再走?
|
||||
|
||||
## 支持
|
||||
|
||||
- 支持ss、ssr、vmess节点链接与订阅
|
||||
- 任意 Telegram 频道抓取
|
||||
- 机场订阅地址抓取解析
|
||||
- 公开互联网页面模糊抓取
|
||||
- 翻墙党论坛新节点信息
|
||||
- 其他节点分享网站
|
||||
- 定时抓取更新
|
||||
- 使用配置文件提供抓取源
|
||||
- 自动检测节点可用性
|
||||
|
||||
## 安装
|
||||
|
||||
### 使用Heroku
|
||||
|
||||
首先 Fork 仓库到你的用户名下,然后修改 assets 文件夹下的html文件,将里面的域名修改为你自己的,最后点击按钮进行部署
|
||||
|
||||
[](https://heroku.com/deploy)
|
||||
|
||||
### 从源码编译
|
||||
|
||||
需要安装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
|
||||
|
||||
## 截图
|
||||
|
||||

|
||||
|
||||

|
||||
@@ -3,10 +3,9 @@ package api
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/zu1k/proxypool/app/cache"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
_ "github.com/heroku/x/hmetrics/onload"
|
||||
"github.com/zu1k/proxypool/app/cache"
|
||||
"github.com/zu1k/proxypool/provider"
|
||||
)
|
||||
|
||||
@@ -15,14 +14,40 @@ var router *gin.Engine
|
||||
func setupRouter() {
|
||||
router = gin.Default()
|
||||
|
||||
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")
|
||||
if text == "" {
|
||||
proxies := cache.GetProxies()
|
||||
clash := provider.Clash{Proxies: proxies}
|
||||
proxyTypes := c.DefaultQuery("type", "")
|
||||
text := ""
|
||||
if proxyTypes == "" {
|
||||
text = cache.GetString("clashproxies")
|
||||
if text == "" {
|
||||
proxies := cache.GetProxies("proxies")
|
||||
clash := provider.Clash{Proxies: proxies}
|
||||
text = clash.Provide()
|
||||
cache.SetString("clashproxies", text)
|
||||
}
|
||||
} else if proxyTypes == "all" {
|
||||
proxies := cache.GetProxies("allproxies")
|
||||
clash := provider.Clash{Proxies: proxies, Types: proxyTypes}
|
||||
text = clash.Provide()
|
||||
cache.SetString("clashproxies", text)
|
||||
} else {
|
||||
proxies := cache.GetProxies("proxies")
|
||||
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("proxies")
|
||||
surge := provider.Surge{Proxies: proxies}
|
||||
text = surge.Provide()
|
||||
cache.SetString("surgeproxies", text)
|
||||
}
|
||||
c.String(200, text)
|
||||
})
|
||||
|
||||
7
app.json
Normal file
7
app.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "proxypool",
|
||||
"description": "自动抓取tg频道、订阅地址、公开互联网上的ss、ssr、vmess节点信息,聚合去重测试可用性后提供节点列表",
|
||||
"repository": "https://github.com/zu1k/proxypool",
|
||||
"logo": "https://raw.githubusercontent.com/zu1k/proxypool/master/assets/proxy.jpg",
|
||||
"keywords": ["golang", "ss", "ssr", "vmess", "shadowsocks", "shadowsocksr"]
|
||||
}
|
||||
14
app/cache/cache.go
vendored
14
app/cache/cache.go
vendored
@@ -10,18 +10,18 @@ import (
|
||||
|
||||
var c = cache.New(cache.NoExpiration, 10*time.Minute)
|
||||
|
||||
func GetProxies() []proxy.Proxy {
|
||||
result, found := c.Get("proxies")
|
||||
func GetProxies(key string) proxy.ProxyList {
|
||||
result, found := c.Get(key)
|
||||
if found {
|
||||
log.Println(len(result.([]proxy.Proxy)))
|
||||
return result.([]proxy.Proxy)
|
||||
log.Println("found cache for:", key, "length:", len(result.(proxy.ProxyList)))
|
||||
return result.(proxy.ProxyList)
|
||||
}
|
||||
log.Println("Cache not found")
|
||||
log.Println("cache not found:", key)
|
||||
return nil
|
||||
}
|
||||
|
||||
func SetProxies(proxies []proxy.Proxy) {
|
||||
c.Set("proxies", proxies, cache.NoExpiration)
|
||||
func SetProxies(key string, proxies proxy.ProxyList) {
|
||||
c.Set(key, proxies, cache.NoExpiration)
|
||||
}
|
||||
|
||||
func SetString(key, value string) {
|
||||
|
||||
36
app/config_test.go
Normal file
36
app/config_test.go
Normal file
@@ -0,0 +1,36 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"testing"
|
||||
|
||||
"github.com/zu1k/proxypool/config"
|
||||
"github.com/zu1k/proxypool/getter"
|
||||
)
|
||||
|
||||
func TestConfigFile(t *testing.T) {
|
||||
c, err := config.Parse("../source.yaml")
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
return
|
||||
}
|
||||
if c == nil {
|
||||
t.Error(errors.New("no sources"))
|
||||
return
|
||||
}
|
||||
for idx, source := range c.Sources {
|
||||
g, err := getter.NewGetter(source.Type, source.Options)
|
||||
if err != nil {
|
||||
t.Error(err, idx)
|
||||
fmt.Println(source)
|
||||
return
|
||||
}
|
||||
if g == nil {
|
||||
t.Error(errors.New("getter is nil:" + strconv.Itoa(idx)))
|
||||
fmt.Println(source)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,6 @@ import (
|
||||
)
|
||||
|
||||
func Cron() {
|
||||
gocron.Every(10).Minutes().Do(CrawlTGChannel)
|
||||
|
||||
_ = gocron.Every(15).Minutes().Do(CrawlGo)
|
||||
<-gocron.Start()
|
||||
}
|
||||
|
||||
35
app/getter.go
Normal file
35
app/getter.go
Normal file
@@ -0,0 +1,35 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/zu1k/proxypool/config"
|
||||
"github.com/zu1k/proxypool/getter"
|
||||
)
|
||||
|
||||
var Getters = make([]getter.Getter, 0)
|
||||
|
||||
func InitConfigAndGetters(path string) (err error) {
|
||||
c, err := config.Parse(path)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if c == nil {
|
||||
return errors.New("no sources")
|
||||
}
|
||||
InitGetters(c.Sources)
|
||||
return nil
|
||||
}
|
||||
|
||||
func InitGetters(sources []config.Source) {
|
||||
Getters = make([]getter.Getter, 0)
|
||||
for _, source := range sources {
|
||||
g, err := getter.NewGetter(source.Type, source.Options)
|
||||
if err == nil && g != nil {
|
||||
Getters = append(Getters, g)
|
||||
fmt.Println("init getter:", source.Type, source.Options)
|
||||
}
|
||||
}
|
||||
fmt.Println("Getter count:", len(Getters))
|
||||
}
|
||||
94
app/task.go
94
app/task.go
@@ -1,48 +1,70 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
"strconv"
|
||||
|
||||
"github.com/zu1k/proxypool/provider"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"sync"
|
||||
|
||||
"github.com/zu1k/proxypool/app/cache"
|
||||
|
||||
"github.com/zu1k/proxypool/getter"
|
||||
"github.com/zu1k/proxypool/config"
|
||||
"github.com/zu1k/proxypool/provider"
|
||||
"github.com/zu1k/proxypool/proxy"
|
||||
"github.com/zu1k/proxypool/tool"
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
func CrawlTGChannel() {
|
||||
proxies := make([]proxy.Proxy, 0)
|
||||
var NeedFetchNewConfigFile = false
|
||||
|
||||
// tg上各种节点分享频道
|
||||
proxies = append(proxies, getter.NewTGChannelGetter("https://t.me/s/ssrList", 200).Get()...)
|
||||
proxies = append(proxies, getter.NewTGChannelGetter("https://t.me/s/SSRSUB", 200).Get()...)
|
||||
proxies = append(proxies, getter.NewTGChannelGetter("https://t.me/s/FreeSSRNode", 200).Get()...)
|
||||
proxies = append(proxies, getter.NewTGChannelGetter("https://t.me/s/ssrlists", 200).Get()...)
|
||||
proxies = append(proxies, getter.NewTGChannelGetter("https://t.me/s/ssrshares", 200).Get()...)
|
||||
proxies = append(proxies, getter.NewTGChannelGetter("https://t.me/s/V2List", 200).Get()...)
|
||||
proxies = append(proxies, getter.NewTGChannelGetter("https://t.me/s/ssrtool", 200).Get()...)
|
||||
proxies = append(proxies, getter.NewTGChannelGetter("https://t.me/s/vmessr", 200).Get()...)
|
||||
proxies = append(proxies, getter.NewTGChannelGetter("https://t.me/s/FreeSSR666", 200).Get()...)
|
||||
proxies = append(proxies, getter.NewTGChannelGetter("https://t.me/s/fanqiang666", 200).Get()...)
|
||||
|
||||
// 各种网站上公开的
|
||||
proxies = append(proxies, getter.WebFreessrXyz{}.Get()...)
|
||||
proxies = append(proxies, getter.WebLucnOrg{}.Get()...)
|
||||
|
||||
// 从web页面模糊获取
|
||||
proxies = append(proxies, getter.NewWebFuzz("https://zfjvpn.gitbook.io/").Get()...)
|
||||
proxies = append(proxies, getter.NewWebFuzz("https://www.freefq.com/d/file/free-ssr/20200811/1f3e9d0d0064f662457062712dcf1b66.txt").Get()...)
|
||||
proxies = append(proxies, getter.NewWebFuzz("https://merlinblog.xyz/wiki/freess.html").Get()...)
|
||||
|
||||
proxies = append(proxies, cache.GetProxies()...)
|
||||
proxies = proxy.Deduplication(proxies)
|
||||
|
||||
num := len(proxies)
|
||||
for i := 0; i < num; i++ {
|
||||
proxies[i].SetName("@tgbotlist_" + strconv.Itoa(rand.Int()))
|
||||
func CrawlGo() {
|
||||
if NeedFetchNewConfigFile {
|
||||
FetchNewConfigFileThenInit()
|
||||
}
|
||||
cache.SetProxies(proxies)
|
||||
wg := &sync.WaitGroup{}
|
||||
var pc = make(chan proxy.Proxy)
|
||||
for _, g := range Getters {
|
||||
wg.Add(1)
|
||||
go g.Get2Chan(pc, wg)
|
||||
}
|
||||
proxies := cache.GetProxies("proxies")
|
||||
go func() {
|
||||
wg.Wait()
|
||||
close(pc)
|
||||
}()
|
||||
for node := range pc {
|
||||
if node != nil {
|
||||
proxies = append(proxies, node)
|
||||
}
|
||||
}
|
||||
// 节点去重
|
||||
proxies = proxies.Deduplication()
|
||||
log.Println("CrawlGo node count:", len(proxies))
|
||||
proxies = provider.Clash{Proxies: proxies}.CleanProxies()
|
||||
proxies.NameAddCounrty().Sort().NameAddIndex()
|
||||
cache.SetProxies("allproxies", proxies)
|
||||
|
||||
// 可用性检测
|
||||
proxies = proxy.CleanBadProxies(proxies)
|
||||
log.Println("CrawlGo clash useable node count:", len(proxies))
|
||||
proxies.NameAddCounrty().Sort().NameAddIndex()
|
||||
cache.SetProxies("proxies", proxies)
|
||||
|
||||
cache.SetString("clashproxies", provider.Clash{Proxies: proxies}.Provide())
|
||||
cache.SetString("surgeproxies", provider.Surge{Proxies: proxies}.Provide())
|
||||
}
|
||||
|
||||
func FetchNewConfigFileThenInit() {
|
||||
fmt.Println("fetch new config file...")
|
||||
resp, err := tool.GetHttpClient().Get("https://raw.githubusercontent.com/zu1k/proxypool/master/source.yaml")
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
body, err := ioutil.ReadAll(resp.Body)
|
||||
|
||||
err = yaml.Unmarshal(body, &config.SourceConfig)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
InitGetters(config.SourceConfig.Sources)
|
||||
}
|
||||
|
||||
BIN
assets/GeoLite2-City.mmdb
Normal file
BIN
assets/GeoLite2-City.mmdb
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 61 MiB |
@@ -1,3 +1,6 @@
|
||||
# 所有节点均从公开互联网上抓取,使用clash自动检查可用性即可
|
||||
# 抓取程序已开源: https://github.com/zu1k/proxypool
|
||||
|
||||
# port of HTTP
|
||||
port: 7890
|
||||
|
||||
119
assets/clash.html
Normal file
119
assets/clash.html
Normal file
@@ -0,0 +1,119 @@
|
||||
<!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配置,每15分钟更新</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>
|
||||
<p>所有节点的Provider(不是都可以用):<a href="https://proxy.tgbot.co/clash/proxies?type=all">https://proxy.tgbot.co/clash/proxies?type=all</a></p>
|
||||
<br>
|
||||
<p>抓取程序已开源:<a href="https://github.com/zu1k/proxypool">https://github.com/zu1k/proxypool</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
130
assets/index.html
Normal file
130
assets/index.html
Normal file
@@ -0,0 +1,130 @@
|
||||
<!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>
|
||||
<meta property="og:site_name" content="免费节点">
|
||||
<meta property="og:description" content="免费ss,免费ssr,免费v2ray,免费vmess,免费vless,免费shadowsocks,免费shadowsocksr,免费shadowsocksrr,免费shadowrocket,免费quan,免费quanx,免费surge,免费小火箭,白嫖ss,白嫖ssr,白嫖v2ray,白嫖vmess,白嫖vless,白嫖shadowsocks,白嫖shadowsocksr,白嫖shadowsocksrr,白嫖shadowrocket,白嫖quan,白嫖quanx,白嫖surge,白嫖小火箭,高速ss,高速ssr,高速v2ray,高速vmess,高速vless,高速shadowsocks,高速shadowsocksr,高速shadowsocksrr,高速shadowrocket,高速quan,高速quanx,高速surge,高速小火箭,公益ss,公益ssr,公益v2ray,公益vmess,公益vless,公益shadowsocks,公益shadowsocksr,公益shadowsocksrr,公益shadowrocket,公益quan,公益quanx,公益surge,公益小火箭,windowsss,windowsssr,windowsv2ray,windowsvmess,windowsvless,windowsshadowsocks,windowsshadowsocksr,windowsshadowsocksrr,windowsshadowrocket,windowsquan,windowsquanx,windowssurge,windows小火箭,androidss,androidssr,androidv2ray,androidvmess,androidvless,androidshadowsocks,androidshadowsocksr,androidshadowsocksrr,androidshadowrocket,androidquan,androidquanx,androidsurge,android小火箭,iosss,iosssr,iosv2ray,iosvmess,iosvless,iosshadowsocks,iosshadowsocksr,iosshadowsocksrr,iosshadowrocket,iosquan,iosquanx,iossurge,ios小火箭,macss,macssr,macv2ray,macvmess,macvless,macshadowsocks,macshadowsocksr,macshadowsocksrr,macshadowrocket,macquan,macquanx,macsurge,mac小火箭,苹果ss,苹果ssr,苹果v2ray,苹果vmess,苹果vless,苹果shadowsocks,苹果shadowsocksr,苹果shadowsocksrr,苹果shadowrocket,苹果quan,苹果quanx,苹果surge,苹果小火箭,安卓ss,安卓ssr,安卓v2ray,安卓vmess,安卓vless,安卓shadowsocks,安卓shadowsocksr,安卓shadowsocksrr,安卓shadowrocket,安卓quan,安卓quanx,安卓surge,安卓小火箭">
|
||||
<meta name="keywords" content="免费ss,免费ssr,免费v2ray,免费vmess,免费vless,免费shadowsocks,免费shadowsocksr,免费shadowsocksrr,免费shadowrocket,免费quan,免费quanx,免费surge,免费小火箭,白嫖ss,白嫖ssr,白嫖v2ray,白嫖vmess,白嫖vless,白嫖shadowsocks,白嫖shadowsocksr,白嫖shadowsocksrr,白嫖shadowrocket,白嫖quan,白嫖quanx,白嫖surge,白嫖小火箭,高速ss,高速ssr,高速v2ray,高速vmess,高速vless,高速shadowsocks,高速shadowsocksr,高速shadowsocksrr,高速shadowrocket,高速quan,高速quanx,高速surge,高速小火箭,公益ss,公益ssr,公益v2ray,公益vmess,公益vless,公益shadowsocks,公益shadowsocksr,公益shadowsocksrr,公益shadowrocket,公益quan,公益quanx,公益surge,公益小火箭,windowsss,windowsssr,windowsv2ray,windowsvmess,windowsvless,windowsshadowsocks,windowsshadowsocksr,windowsshadowsocksrr,windowsshadowrocket,windowsquan,windowsquanx,windowssurge,windows小火箭,androidss,androidssr,androidv2ray,androidvmess,androidvless,androidshadowsocks,androidshadowsocksr,androidshadowsocksrr,androidshadowrocket,androidquan,androidquanx,androidsurge,android小火箭,iosss,iosssr,iosv2ray,iosvmess,iosvless,iosshadowsocks,iosshadowsocksr,iosshadowsocksrr,iosshadowrocket,iosquan,iosquanx,iossurge,ios小火箭,macss,macssr,macv2ray,macvmess,macvless,macshadowsocks,macshadowsocksr,macshadowsocksrr,macshadowrocket,macquan,macquanx,macsurge,mac小火箭,苹果ss,苹果ssr,苹果v2ray,苹果vmess,苹果vless,苹果shadowsocks,苹果shadowsocksr,苹果shadowsocksrr,苹果shadowrocket,苹果quan,苹果quanx,苹果surge,苹果小火箭,安卓ss,安卓ssr,安卓v2ray,安卓vmess,安卓vless,安卓shadowsocks,安卓shadowsocksr,安卓shadowsocksrr,安卓shadowrocket,安卓quan,安卓quanx,安卓surge,安卓小火箭">
|
||||
<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节点信息,聚合去重后提供节点列表,每15分钟更新</p>
|
||||
<br>
|
||||
<h5><a href="/clash">Clash</a></h5>
|
||||
<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>
|
||||
<p>所有节点的Provider(不是都可以用):<a href="https://proxy.tgbot.co/clash/proxies?type=all">https://proxy.tgbot.co/clash/proxies?type=all</a>
|
||||
</p>
|
||||
<br>
|
||||
<h5><a href="/surge">Surge</a></h5>
|
||||
<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>
|
||||
BIN
assets/proxy.jpg
Normal file
BIN
assets/proxy.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 72 KiB |
25
assets/source.yaml
Normal file
25
assets/source.yaml
Normal file
@@ -0,0 +1,25 @@
|
||||
sources:
|
||||
- type: webfuzzsub
|
||||
options:
|
||||
url: https://raw.githubusercontent.com/du5/free/master/sub.list
|
||||
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://raw.githubusercontent.com/ssrsub/ssr/master/v2ray
|
||||
|
||||
- type: webfuzz
|
||||
options:
|
||||
url: https://merlinblog.xyz/wiki/freess.html
|
||||
|
||||
- type: tgchannel
|
||||
options:
|
||||
channel: ssrList
|
||||
num: 200
|
||||
|
||||
- type: web-fanqiangdang
|
||||
options:
|
||||
url: https://fanqiangdang.com/forum.php?mod=rss&fid=50&auth=0
|
||||
num: 200
|
||||
|
||||
- type: web-freessrxyz
|
||||
options:
|
||||
45
assets/surge.conf
Normal file
45
assets/surge.conf
Normal 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
|
||||
86
assets/surge.html
Normal file
86
assets/surge.html
Normal file
@@ -0,0 +1,86 @@
|
||||
<!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>免费Surge节点</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>免费Surge节点</strong></h1>
|
||||
<div class='article'>
|
||||
<p>自动抓取tg频道、订阅地址、公开互联网上的ss、vmess节点信息,聚合去重后提供Surge节点列表,每15分钟更新</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>
|
||||
50
config/config.go
Normal file
50
config/config.go
Normal file
@@ -0,0 +1,50 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
||||
"github.com/ghodss/yaml"
|
||||
"github.com/zu1k/proxypool/tool"
|
||||
)
|
||||
|
||||
type Source struct {
|
||||
Type string `json:"type" yaml:"type"`
|
||||
Options tool.Options `json:"options" yaml:"options"`
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
Sources []Source `json:"sources" yaml:"sources"`
|
||||
}
|
||||
|
||||
var SourceConfig = Config{}
|
||||
|
||||
func Parse(path string) (*Config, error) {
|
||||
fileData, err := readFile(path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
SourceConfig = Config{}
|
||||
err = yaml.Unmarshal(fileData, &SourceConfig)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &SourceConfig, nil
|
||||
}
|
||||
|
||||
func readFile(path string) ([]byte, error) {
|
||||
if _, err := os.Stat(path); os.IsNotExist(err) {
|
||||
return nil, err
|
||||
}
|
||||
data, err := ioutil.ReadFile(path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if len(data) == 0 {
|
||||
return nil, fmt.Errorf("Configuration file %s is empty", path)
|
||||
}
|
||||
|
||||
return data, err
|
||||
}
|
||||
BIN
docs/fast.png
Normal file
BIN
docs/fast.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 99 KiB |
BIN
docs/speedtest.png
Normal file
BIN
docs/speedtest.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 188 KiB |
@@ -1,13 +1,33 @@
|
||||
package getter
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/zu1k/proxypool/proxy"
|
||||
"github.com/zu1k/proxypool/tool"
|
||||
)
|
||||
|
||||
type Getter interface {
|
||||
Get() []proxy.Proxy
|
||||
Get() proxy.ProxyList
|
||||
Get2Chan(pc chan proxy.Proxy, wg *sync.WaitGroup)
|
||||
}
|
||||
|
||||
type creator func(options tool.Options) (getter Getter, err error)
|
||||
|
||||
var creatorMap = make(map[string]creator)
|
||||
|
||||
func Register(sourceType string, c creator) {
|
||||
creatorMap[sourceType] = c
|
||||
}
|
||||
|
||||
func NewGetter(sourceType string, options tool.Options) (getter Getter, err error) {
|
||||
c, ok := creatorMap[sourceType]
|
||||
if ok {
|
||||
return c(options)
|
||||
}
|
||||
return nil, ErrorCreaterNotSupported
|
||||
}
|
||||
|
||||
func String2Proxy(link string) proxy.Proxy {
|
||||
@@ -17,6 +37,8 @@ func String2Proxy(link string) proxy.Proxy {
|
||||
data, err = proxy.ParseSSRLink(link)
|
||||
} else if strings.HasPrefix(link, "vmess://") {
|
||||
data, err = proxy.ParseVmessLink(link)
|
||||
} else if strings.HasPrefix(link, "ss://") {
|
||||
data, err = proxy.ParseSSLink(link)
|
||||
}
|
||||
if err != nil {
|
||||
return nil
|
||||
@@ -24,20 +46,40 @@ func String2Proxy(link string) proxy.Proxy {
|
||||
return data
|
||||
}
|
||||
|
||||
func StringArray2ProxyArray(origin []string) []proxy.Proxy {
|
||||
var err error
|
||||
results := make([]proxy.Proxy, 0)
|
||||
func StringArray2ProxyArray(origin []string) proxy.ProxyList {
|
||||
results := make(proxy.ProxyList, 0)
|
||||
for _, link := range origin {
|
||||
var data proxy.Proxy
|
||||
if strings.HasPrefix(link, "ssr://") {
|
||||
data, err = proxy.ParseSSRLink(link)
|
||||
} else if strings.HasPrefix(link, "vmess://") {
|
||||
data, err = proxy.ParseVmessLink(link)
|
||||
}
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
results = append(results, data)
|
||||
results = append(results, String2Proxy(link))
|
||||
}
|
||||
return results
|
||||
}
|
||||
|
||||
func GrepLinksFromString(text string) []string {
|
||||
results := proxy.GrepSSRLinkFromString(text)
|
||||
results = append(results, proxy.GrepVmessLinkFromString(text)...)
|
||||
results = append(results, proxy.GrepSSLinkFromString(text)...)
|
||||
return results
|
||||
}
|
||||
|
||||
func FuzzParseProxyFromString(text string) proxy.ProxyList {
|
||||
return StringArray2ProxyArray(GrepLinksFromString(text))
|
||||
}
|
||||
|
||||
var (
|
||||
ErrorUrlNotFound = errors.New("url should be specified")
|
||||
ErrorCreaterNotSupported = errors.New("type not supported")
|
||||
)
|
||||
|
||||
func AssertTypeStringNotNull(i interface{}) (str string, err error) {
|
||||
switch i.(type) {
|
||||
case string:
|
||||
str = i.(string)
|
||||
if str == "" {
|
||||
return "", errors.New("string is null")
|
||||
}
|
||||
return str, nil
|
||||
default:
|
||||
return "", errors.New("type is not string")
|
||||
}
|
||||
return "", nil
|
||||
}
|
||||
|
||||
@@ -1,13 +1,61 @@
|
||||
package getter
|
||||
|
||||
import "github.com/zu1k/proxypool/proxy"
|
||||
import (
|
||||
"io/ioutil"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/zu1k/proxypool/proxy"
|
||||
"github.com/zu1k/proxypool/tool"
|
||||
)
|
||||
|
||||
func init() {
|
||||
Register("subscribe", NewSubscribe)
|
||||
}
|
||||
|
||||
type Subscribe struct {
|
||||
NumNeeded int
|
||||
Results []string
|
||||
Url string
|
||||
Url string
|
||||
}
|
||||
|
||||
func (s Subscribe) Get() []proxy.Proxy {
|
||||
return nil
|
||||
func (s *Subscribe) Get() proxy.ProxyList {
|
||||
resp, err := tool.GetHttpClient().Get(s.Url)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
body, err := ioutil.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
nodesString, err := tool.Base64DecodeString(string(body))
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
nodesString = strings.ReplaceAll(nodesString, "\t", "")
|
||||
|
||||
nodes := strings.Split(nodesString, "\n")
|
||||
return StringArray2ProxyArray(nodes)
|
||||
}
|
||||
|
||||
func (s *Subscribe) Get2Chan(pc chan proxy.Proxy, wg *sync.WaitGroup) {
|
||||
defer wg.Done()
|
||||
nodes := s.Get()
|
||||
for _, node := range nodes {
|
||||
pc <- node
|
||||
}
|
||||
}
|
||||
|
||||
func NewSubscribe(options tool.Options) (getter Getter, err error) {
|
||||
urlInterface, found := options["url"]
|
||||
if found {
|
||||
url, err := AssertTypeStringNotNull(urlInterface)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &Subscribe{
|
||||
Url: url,
|
||||
}, nil
|
||||
}
|
||||
return nil, ErrorUrlNotFound
|
||||
}
|
||||
|
||||
@@ -2,49 +2,84 @@ package getter
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sync"
|
||||
|
||||
"github.com/gocolly/colly"
|
||||
"github.com/zu1k/proxypool/proxy"
|
||||
"github.com/zu1k/proxypool/tool"
|
||||
)
|
||||
|
||||
func init() {
|
||||
Register("tgchannel", NewTGChannelGetter)
|
||||
}
|
||||
|
||||
type TGChannelGetter struct {
|
||||
c *colly.Collector
|
||||
NumNeeded int
|
||||
Results []string
|
||||
results []string
|
||||
Url string
|
||||
}
|
||||
|
||||
func NewTGChannelGetter(url string, numNeeded int) *TGChannelGetter {
|
||||
if numNeeded <= 0 {
|
||||
numNeeded = 200
|
||||
func NewTGChannelGetter(options tool.Options) (getter Getter, err error) {
|
||||
num, found := options["num"]
|
||||
t := 200
|
||||
switch num.(type) {
|
||||
case int:
|
||||
t = num.(int)
|
||||
case float64:
|
||||
t = int(num.(float64))
|
||||
}
|
||||
return &TGChannelGetter{
|
||||
c: colly.NewCollector(),
|
||||
NumNeeded: numNeeded,
|
||||
Results: make([]string, 0),
|
||||
Url: url,
|
||||
|
||||
if !found || t <= 0 {
|
||||
t = 200
|
||||
}
|
||||
urlInterface, found := options["channel"]
|
||||
if found {
|
||||
url, err := AssertTypeStringNotNull(urlInterface)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &TGChannelGetter{
|
||||
c: colly.NewCollector(),
|
||||
NumNeeded: t,
|
||||
Url: "https://t.me/s/" + url,
|
||||
}, nil
|
||||
}
|
||||
return nil, ErrorUrlNotFound
|
||||
}
|
||||
|
||||
func (g TGChannelGetter) Get() []proxy.Proxy {
|
||||
func (g *TGChannelGetter) Get() proxy.ProxyList {
|
||||
result := make(proxy.ProxyList, 0)
|
||||
g.results = make([]string, 0)
|
||||
// 找到所有的文字消息
|
||||
g.c.OnHTML("div.tgme_widget_message_text", func(e *colly.HTMLElement) {
|
||||
g.Results = append(g.Results, proxy.GrepSSRLinkFromString(e.Text)...)
|
||||
g.Results = append(g.Results, proxy.GrepVmessLinkFromString(e.Text)...)
|
||||
g.results = append(g.results, GrepLinksFromString(e.Text)...)
|
||||
// 抓取到http链接,有可能是订阅链接或其他链接,无论如何试一下
|
||||
subUrls := urlRe.FindAllString(e.Text, -1)
|
||||
for _, url := range subUrls {
|
||||
result = append(result, (&Subscribe{Url: url}).Get()...)
|
||||
}
|
||||
})
|
||||
|
||||
// 找到之前消息页面的链接,加入访问队列
|
||||
g.c.OnHTML("link[rel=prev]", func(e *colly.HTMLElement) {
|
||||
if len(g.Results) < g.NumNeeded {
|
||||
if len(g.results) < g.NumNeeded {
|
||||
_ = e.Request.Visit(e.Attr("href"))
|
||||
}
|
||||
})
|
||||
|
||||
g.Results = make([]string, 0)
|
||||
g.results = make([]string, 0)
|
||||
err := g.c.Visit(g.Url)
|
||||
if err != nil {
|
||||
_ = fmt.Errorf("%s", err.Error())
|
||||
}
|
||||
|
||||
return StringArray2ProxyArray(g.Results)
|
||||
return append(result, StringArray2ProxyArray(g.results)...)
|
||||
}
|
||||
|
||||
func (g *TGChannelGetter) Get2Chan(pc chan proxy.Proxy, wg *sync.WaitGroup) {
|
||||
defer wg.Done()
|
||||
nodes := g.Get()
|
||||
for _, node := range nodes {
|
||||
pc <- node
|
||||
}
|
||||
}
|
||||
|
||||
81
getter/web_fanqiangdang.go
Normal file
81
getter/web_fanqiangdang.go
Normal file
@@ -0,0 +1,81 @@
|
||||
package getter
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sync"
|
||||
|
||||
"github.com/gocolly/colly"
|
||||
"github.com/zu1k/proxypool/proxy"
|
||||
"github.com/zu1k/proxypool/tool"
|
||||
)
|
||||
|
||||
func init() {
|
||||
Register("web-fanqiangdang", NewWebFanqiangdangGetter)
|
||||
}
|
||||
|
||||
type WebFanqiangdang struct {
|
||||
c *colly.Collector
|
||||
NumNeeded int
|
||||
Url string
|
||||
results []string
|
||||
}
|
||||
|
||||
func NewWebFanqiangdangGetter(options tool.Options) (getter Getter, err error) {
|
||||
num, found := options["num"]
|
||||
|
||||
t := 200
|
||||
switch num.(type) {
|
||||
case int:
|
||||
t = num.(int)
|
||||
case float64:
|
||||
t = int(num.(float64))
|
||||
}
|
||||
|
||||
if !found || t <= 0 {
|
||||
t = 200
|
||||
}
|
||||
urlInterface, found := options["url"]
|
||||
if found {
|
||||
url, err := AssertTypeStringNotNull(urlInterface)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &WebFanqiangdang{
|
||||
c: colly.NewCollector(),
|
||||
NumNeeded: t,
|
||||
Url: url,
|
||||
}, nil
|
||||
}
|
||||
return nil, ErrorUrlNotFound
|
||||
}
|
||||
|
||||
func (w *WebFanqiangdang) Get() proxy.ProxyList {
|
||||
w.results = make([]string, 0)
|
||||
// 找到所有的文字消息
|
||||
w.c.OnHTML("td.t_f", func(e *colly.HTMLElement) {
|
||||
w.results = append(w.results, GrepLinksFromString(e.Text)...)
|
||||
})
|
||||
|
||||
// 从订阅中取出每一页,因为是订阅,所以都比较新
|
||||
w.c.OnXML("//item//link", func(e *colly.XMLElement) {
|
||||
if len(w.results) < w.NumNeeded {
|
||||
_ = e.Request.Visit(e.Text)
|
||||
}
|
||||
})
|
||||
|
||||
w.results = make([]string, 0)
|
||||
err := w.c.Visit(w.Url)
|
||||
if err != nil {
|
||||
_ = fmt.Errorf("%s", err.Error())
|
||||
}
|
||||
|
||||
return StringArray2ProxyArray(w.results)
|
||||
}
|
||||
|
||||
func (w *WebFanqiangdang) Get2Chan(pc chan proxy.Proxy, wg *sync.WaitGroup) {
|
||||
defer wg.Done()
|
||||
nodes := w.Get()
|
||||
for _, node := range nodes {
|
||||
pc <- node
|
||||
}
|
||||
}
|
||||
@@ -3,11 +3,16 @@ package getter
|
||||
import (
|
||||
"encoding/json"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"sync"
|
||||
|
||||
"github.com/zu1k/proxypool/proxy"
|
||||
"github.com/zu1k/proxypool/tool"
|
||||
)
|
||||
|
||||
func init() {
|
||||
Register("web-freessrxyz", NewWebFreessrxyzGetter)
|
||||
}
|
||||
|
||||
const (
|
||||
freessrxyzSsrLink = "https://api.free-ssr.xyz/ssr"
|
||||
freessrxyzV2rayLink = "https://api.free-ssr.xyz/v2ray"
|
||||
@@ -16,14 +21,26 @@ const (
|
||||
type WebFreessrXyz struct {
|
||||
}
|
||||
|
||||
func (w WebFreessrXyz) Get() []proxy.Proxy {
|
||||
func NewWebFreessrxyzGetter(options tool.Options) (getter Getter, err error) {
|
||||
return &WebFreessrXyz{}, nil
|
||||
}
|
||||
|
||||
func (w *WebFreessrXyz) Get() proxy.ProxyList {
|
||||
results := freessrxyzFetch(freessrxyzSsrLink)
|
||||
results = append(results, freessrxyzFetch(freessrxyzV2rayLink)...)
|
||||
return results
|
||||
}
|
||||
|
||||
func freessrxyzFetch(link string) []proxy.Proxy {
|
||||
resp, err := http.Get(link)
|
||||
func (w *WebFreessrXyz) Get2Chan(pc chan proxy.Proxy, wg *sync.WaitGroup) {
|
||||
defer wg.Done()
|
||||
nodes := w.Get()
|
||||
for _, node := range nodes {
|
||||
pc <- node
|
||||
}
|
||||
}
|
||||
|
||||
func freessrxyzFetch(link string) proxy.ProxyList {
|
||||
resp, err := tool.GetHttpClient().Get(link)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -2,17 +2,22 @@ package getter
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"sync"
|
||||
|
||||
"github.com/zu1k/proxypool/proxy"
|
||||
"github.com/zu1k/proxypool/tool"
|
||||
)
|
||||
|
||||
func init() {
|
||||
Register("webfuzz", NewWebFuzzGetter)
|
||||
}
|
||||
|
||||
type WebFuzz struct {
|
||||
Url string
|
||||
}
|
||||
|
||||
func (w WebFuzz) Get() []proxy.Proxy {
|
||||
resp, err := http.Get(w.Url)
|
||||
func (w *WebFuzz) Get() proxy.ProxyList {
|
||||
resp, err := tool.GetHttpClient().Get(w.Url)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
@@ -21,14 +26,26 @@ func (w WebFuzz) Get() []proxy.Proxy {
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
text := string(body)
|
||||
|
||||
results := proxy.GrepSSRLinkFromString(text)
|
||||
results = append(results, proxy.GrepVmessLinkFromString(text)...)
|
||||
|
||||
return StringArray2ProxyArray(results)
|
||||
return FuzzParseProxyFromString(string(body))
|
||||
}
|
||||
|
||||
func NewWebFuzz(url string) *WebFuzz {
|
||||
return &WebFuzz{Url: url}
|
||||
func (w *WebFuzz) Get2Chan(pc chan proxy.Proxy, wg *sync.WaitGroup) {
|
||||
defer wg.Done()
|
||||
nodes := w.Get()
|
||||
for _, node := range nodes {
|
||||
pc <- node
|
||||
}
|
||||
}
|
||||
|
||||
func NewWebFuzzGetter(options tool.Options) (getter Getter, err error) {
|
||||
urlInterface, found := options["url"]
|
||||
if found {
|
||||
url, err := AssertTypeStringNotNull(urlInterface)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &WebFuzz{Url: url}, nil
|
||||
}
|
||||
return nil, ErrorUrlNotFound
|
||||
}
|
||||
|
||||
89
getter/web_fuzz_sub.go
Normal file
89
getter/web_fuzz_sub.go
Normal file
@@ -0,0 +1,89 @@
|
||||
package getter
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"regexp"
|
||||
"sync"
|
||||
|
||||
"github.com/zu1k/proxypool/proxy"
|
||||
"github.com/zu1k/proxypool/tool"
|
||||
)
|
||||
|
||||
func init() {
|
||||
Register("webfuzzsub", NewWebFuzzSubGetter)
|
||||
}
|
||||
|
||||
type WebFuzzSub struct {
|
||||
Url string
|
||||
}
|
||||
|
||||
func (w *WebFuzzSub) Get() proxy.ProxyList {
|
||||
resp, err := tool.GetHttpClient().Get(w.Url)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
body, err := ioutil.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
text := string(body)
|
||||
subUrls := urlRe.FindAllString(text, -1)
|
||||
result := make(proxy.ProxyList, 0)
|
||||
for _, url := range subUrls {
|
||||
result = append(result, (&Subscribe{Url: url}).Get()...)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
func (w *WebFuzzSub) Get2Chan(pc chan proxy.Proxy, wg *sync.WaitGroup) {
|
||||
defer wg.Done()
|
||||
nodes := w.Get()
|
||||
for _, node := range nodes {
|
||||
pc <- node
|
||||
}
|
||||
}
|
||||
|
||||
func NewWebFuzzSubGetter(options tool.Options) (getter Getter, err error) {
|
||||
urlInterface, found := options["url"]
|
||||
if found {
|
||||
url, err := AssertTypeStringNotNull(urlInterface)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &WebFuzzSub{Url: url}, nil
|
||||
}
|
||||
return nil, ErrorUrlNotFound
|
||||
}
|
||||
|
||||
var urlRe = regexp.MustCompile(urlPattern)
|
||||
|
||||
const (
|
||||
// 匹配 IP4
|
||||
ip4Pattern = `((25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(25[0-5]|2[0-4]\d|[01]?\d\d?)`
|
||||
|
||||
// 匹配 IP6,参考以下网页内容:
|
||||
// http://blog.csdn.net/jiangfeng08/article/details/7642018
|
||||
ip6Pattern = `(([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|` +
|
||||
`(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|` +
|
||||
`(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|` +
|
||||
`(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|` +
|
||||
`(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|` +
|
||||
`(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|` +
|
||||
`(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|` +
|
||||
`(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))`
|
||||
|
||||
// 同时匹配 IP4 和 IP6
|
||||
ipPattern = "(" + ip4Pattern + ")|(" + ip6Pattern + ")"
|
||||
|
||||
// 匹配域名
|
||||
domainPattern = `[a-zA-Z0-9][a-zA-Z0-9_-]{0,62}(\.[a-zA-Z0-9][a-zA-Z0-9_-]{0,62})*(\.[a-zA-Z][a-zA-Z0-9]{0,10}){1}`
|
||||
|
||||
// 匹配 URL
|
||||
urlPattern = `((https|http)?://)?` + // 协议
|
||||
`(([0-9a-zA-Z]+:)?[0-9a-zA-Z_-]+@)?` + // pwd:user@
|
||||
"(" + ipPattern + "|(" + domainPattern + "))" + // IP 或域名
|
||||
`(:\d{1,5})?` + // 端口
|
||||
`(/+[a-zA-Z0-9][a-zA-Z0-9_.-]*)*/*` + // path
|
||||
`(\?([a-zA-Z0-9_-]+(=.*&?)*)*)*` // query
|
||||
)
|
||||
@@ -1,70 +0,0 @@
|
||||
package getter
|
||||
|
||||
import (
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
|
||||
"github.com/zu1k/proxypool/tool"
|
||||
|
||||
"github.com/zu1k/proxypool/proxy"
|
||||
)
|
||||
|
||||
const lucnorgSsrLink = "https://lncn.org/api/ssrList"
|
||||
|
||||
type WebLucnOrg struct {
|
||||
}
|
||||
|
||||
func (w WebLucnOrg) Get() []proxy.Proxy {
|
||||
resp, err := http.Post(lucnorgSsrLink, "", nil)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
body, err := ioutil.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
response := struct {
|
||||
Code string `json:"code"`
|
||||
Ssrs string `json:"ssrs"`
|
||||
}{}
|
||||
err = json.Unmarshal(body, &response)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
dec := decryptAesForLucn(response.Code, response.Ssrs)
|
||||
if dec == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
type node struct {
|
||||
Url string `json:"url"`
|
||||
}
|
||||
ssrs := make([]node, 0)
|
||||
err = json.Unmarshal(dec, &ssrs)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
result := make([]string, 0)
|
||||
for _, node := range ssrs {
|
||||
result = append(result, node.Url)
|
||||
}
|
||||
return StringArray2ProxyArray(result)
|
||||
}
|
||||
|
||||
func decryptAesForLucn(code string, c string) []byte {
|
||||
if code == "" {
|
||||
code = "abclnv561cqqfg30"
|
||||
}
|
||||
cipher, err := base64.StdEncoding.DecodeString(c)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
result := tool.AesEcbDecryptWithPKCS7Unpadding(cipher, []byte(code))
|
||||
return result
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package getter
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestWebLucnOrg_Get(t *testing.T) {
|
||||
fmt.Println(WebLucnOrg{}.Get())
|
||||
}
|
||||
|
||||
func TestWebFreessrXyz_Get(t *testing.T) {
|
||||
fmt.Println(WebFreessrXyz{}.Get())
|
||||
}
|
||||
|
||||
func TestWebFuzz_Get(t *testing.T) {
|
||||
fmt.Println(NewWebFuzz("https://merlinblog.xyz/wiki/freess.html").Get())
|
||||
}
|
||||
15
go.mod
15
go.mod
@@ -3,11 +3,13 @@ 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
|
||||
github.com/antchfx/xmlquery v1.2.4 // indirect
|
||||
github.com/antchfx/xpath v1.1.8 // indirect
|
||||
github.com/ghodss/yaml v1.0.0
|
||||
github.com/gin-gonic/gin v1.6.3
|
||||
github.com/go-playground/validator/v10 v10.3.0 // indirect
|
||||
github.com/gobwas/glob v0.2.3 // indirect
|
||||
@@ -17,14 +19,21 @@ require (
|
||||
github.com/jasonlvhit/gocron v0.0.1
|
||||
github.com/json-iterator/go v1.1.10 // indirect
|
||||
github.com/kennygrant/sanitize v1.2.4 // indirect
|
||||
github.com/mkevac/debugcharts v0.0.0-20191222103121-ae1c48aa8615
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.1 // indirect
|
||||
github.com/oschwald/geoip2-golang v1.4.0
|
||||
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/shirou/gopsutil v2.20.7+incompatible // indirect
|
||||
github.com/temoto/robotstxt v1.1.1 // indirect
|
||||
golang.org/x/net v0.0.0-20200602114024-627f9648deb9 // 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/sys v0.0.0-20200814200057-3d37ad5750ed // indirect
|
||||
golang.org/x/text v0.3.3 // indirect
|
||||
google.golang.org/appengine v1.6.6 // indirect
|
||||
google.golang.org/protobuf v1.25.0 // indirect
|
||||
gopkg.in/yaml.v2 v2.3.0 // indirect
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
|
||||
gopkg.in/yaml.v2 v2.3.0
|
||||
)
|
||||
|
||||
77
go.sum
77
go.sum
@@ -3,9 +3,15 @@ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT
|
||||
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
|
||||
contrib.go.opencensus.io/exporter/ocagent v0.6.0/go.mod h1:zmKjrJcdo0aYcVS7bmEeSEBLPA9YJp5bjrofdU3pIXs=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
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/PuerkitoBio/goquery v1.5.1 h1:PSPBGne8NIUWw+/7vFBV+kG2J/5MOjbzc7154OaKCSE=
|
||||
github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc=
|
||||
github.com/StackExchange/wmi v0.0.0-20170410192909-ea383cf3ba6e/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
|
||||
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d h1:G0m3OIz70MZUWq3EgK3CesDbo8upS2Vm9/P3FtgI+Jk=
|
||||
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
|
||||
github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g=
|
||||
github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y=
|
||||
github.com/andybalholm/cascadia v1.2.0 h1:vuRCkM5Ozh/BfmsaTm26kbjm0mIOM3yS5Ek/F5h18aE=
|
||||
@@ -27,20 +33,31 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
|
||||
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/dgryski/go-metro v0.0.0-20180109044635-280f6062b5bc/go.mod h1:c9O8+fpSOX1DM8cPNSkX/qsBWdkD4yd2dpciOWQjpBw=
|
||||
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.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g=
|
||||
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/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
|
||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
|
||||
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
||||
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-ini/ini v1.33.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
|
||||
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
||||
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
|
||||
github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8=
|
||||
github.com/go-ole/go-ole v1.2.4 h1:nNBDSCOigTSiarFpYE9J/KtEA1IOW4CNeqT9TQDqCxI=
|
||||
github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM=
|
||||
github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A=
|
||||
github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
|
||||
github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q=
|
||||
@@ -57,6 +74,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/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
|
||||
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
|
||||
@@ -95,6 +114,10 @@ github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OI
|
||||
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
|
||||
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
||||
github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ=
|
||||
github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
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.2.0/go.mod h1:mJzapYve32yjrKlk9GbyCZHuPgZsrbyIbyKhSzOpg6s=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.9.4/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.9.6/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
|
||||
@@ -125,6 +148,7 @@ github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQL
|
||||
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.2/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=
|
||||
@@ -139,6 +163,10 @@ github.com/lstoll/grpce v1.7.0/go.mod h1:XiCWl3R+avNCT7KsTjv3qCblgsSqd0SC4ymySrH
|
||||
github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ=
|
||||
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
|
||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||
github.com/miekg/dns v1.1.29 h1:xHBEhR+t5RzcFJjBLJlax2daXOrTYtr9z4WdKEfWFzg=
|
||||
github.com/miekg/dns v1.1.29/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM=
|
||||
github.com/mkevac/debugcharts v0.0.0-20191222103121-ae1c48aa8615 h1:/mD+ABZyXD39BzJI2XyRJlqdZG11gXFo0SSynL+OFeU=
|
||||
github.com/mkevac/debugcharts v0.0.0-20191222103121-ae1c48aa8615/go.mod h1:Ad7oeElCZqA1Ufj0U9/liOF4BtVepxRcTvr2ey7zTvM=
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
|
||||
@@ -152,6 +180,12 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W
|
||||
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/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
|
||||
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/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=
|
||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
@@ -167,8 +201,14 @@ github.com/rollbar/rollbar-go v1.2.0/go.mod h1:czC86b8U4xdUH7W2C6gomi2jutLm8qK0O
|
||||
github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca h1:NugYot0LIVPxTvN8n+Kvkn6TrbMyxQiuvKdEwFdR9vI=
|
||||
github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca/go.mod h1:uugorj2VCxiV1x+LzaIdVa9b4S4qGAcH6cbhh4qVxOU=
|
||||
github.com/shirou/gopsutil v0.0.0-20180427012116-c95755e4bcd7/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
|
||||
github.com/shirou/gopsutil v2.19.11+incompatible h1:lJHR0foqAjI4exXqWsU3DbH7bX1xvdhGdnXTIARA9W4=
|
||||
github.com/shirou/gopsutil v2.19.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
|
||||
github.com/shirou/gopsutil v2.20.7+incompatible h1:Ymv4OD12d6zm+2yONe39VSmp2XooJe8za7ngOLW/o/w=
|
||||
github.com/shirou/gopsutil v2.20.7+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
|
||||
github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4 h1:udFKJ0aHUL60LboW/A+DfgoHVedieIzIXE8uylPue0U=
|
||||
github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc=
|
||||
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
|
||||
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 v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
|
||||
@@ -180,8 +220,9 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
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 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
|
||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/temoto/robotstxt v1.1.1 h1:Gh8RCs8ouX3hRSxxK7B1mO5RFByQ4CmJZDwgom++JaA=
|
||||
github.com/temoto/robotstxt v1.1.1/go.mod h1:+1AmkuG3IYkh1kv0d2qEB9Le88ehNO0zwOr3ujewlOo=
|
||||
github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo=
|
||||
@@ -199,6 +240,13 @@ go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/
|
||||
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20190829043050-9756ffdc2472/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-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
@@ -207,6 +255,7 @@ golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvx
|
||||
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
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=
|
||||
@@ -223,11 +272,13 @@ golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/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 h1:pNX+40auqi2JqRfOP1akLGtYcn15TUbkhwuCO3foqqM=
|
||||
golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
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=
|
||||
@@ -237,6 +288,8 @@ 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/sys v0.0.0-20171017063910-8dbc5d05d6ed/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-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
@@ -248,16 +301,21 @@ golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191220220014-0732a990476f/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-20200625212154-ddb9806d33ae/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=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
@@ -271,6 +329,9 @@ golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3
|
||||
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/tools v0.0.0-20191216052735-49a3e744a425 h1:VvQyQJN0tSuecqgcIxMWnnfG5kSmgy9KZR9sW3W5QeA=
|
||||
golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
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=
|
||||
gonum.org/v1/gonum v0.0.0-20190502212712-4a2eb0188cbc/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0=
|
||||
@@ -290,6 +351,7 @@ google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRn
|
||||
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
||||
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
||||
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.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio=
|
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
@@ -310,8 +372,11 @@ google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4
|
||||
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
|
||||
gopkg.in/caio/go-tdigest.v2 v2.3.0/go.mod h1:HPfh/CLN8UWDMOC76lqxVeKa5E24ypoVuTj4BLMb9cU=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
|
||||
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/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||
gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
|
||||
@@ -322,6 +387,8 @@ gopkg.in/yaml.v2 v2.2.2/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 h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
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=
|
||||
|
||||
38
main.go
38
main.go
@@ -1,14 +1,50 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"net/http"
|
||||
_ "net/http/pprof"
|
||||
|
||||
_ "github.com/mkevac/debugcharts"
|
||||
"github.com/zu1k/proxypool/api"
|
||||
"github.com/zu1k/proxypool/app"
|
||||
"github.com/zu1k/proxypool/proxy"
|
||||
)
|
||||
|
||||
var (
|
||||
debugMode = false
|
||||
configFilePath = ""
|
||||
)
|
||||
|
||||
func main() {
|
||||
flag.StringVar(&configFilePath, "c", "", "path to config file: source.yaml")
|
||||
flag.BoolVar(&debugMode, "d", false, "debug mode")
|
||||
flag.Parse()
|
||||
|
||||
if debugMode {
|
||||
go pprof()
|
||||
}
|
||||
|
||||
if configFilePath == "" {
|
||||
app.NeedFetchNewConfigFile = true
|
||||
} else {
|
||||
err := app.InitConfigAndGetters(configFilePath)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
}
|
||||
proxy.InitGeoIpDB()
|
||||
|
||||
go app.Cron()
|
||||
fmt.Println("Do the first crawl...")
|
||||
app.CrawlTGChannel()
|
||||
go app.CrawlGo()
|
||||
api.Run()
|
||||
}
|
||||
|
||||
func pprof() {
|
||||
ip := "127.0.0.1:6060"
|
||||
if err := http.ListenAndServe(ip, nil); err != nil {
|
||||
fmt.Printf("start pprof failed on %s\n", ip)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -7,16 +7,40 @@ import (
|
||||
)
|
||||
|
||||
type Clash struct {
|
||||
Proxies []proxy.Proxy `yaml:"proxies"`
|
||||
Proxies proxy.ProxyList `yaml:"proxies"`
|
||||
Types string `yaml:"type"`
|
||||
}
|
||||
|
||||
func (c Clash) CleanProxies() (proxies proxy.ProxyList) {
|
||||
proxies = make(proxy.ProxyList, 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.TypeName() == t {
|
||||
resultBuilder.WriteString(p.ToClash() + "\n")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,28 +48,24 @@ func (c Clash) Provide() string {
|
||||
}
|
||||
|
||||
func checkClashSupport(p proxy.Proxy) bool {
|
||||
switch p.(type) {
|
||||
case *proxy.ShadowsocksR:
|
||||
switch p.TypeName() {
|
||||
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
|
||||
}
|
||||
default:
|
||||
return false
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func checkInList(list []string, item string) bool {
|
||||
for _, i := range list {
|
||||
if item == i {
|
||||
case "ss":
|
||||
ss := p.(*proxy.Shadowsocks)
|
||||
if checkInList(ssCipherList, ss.Cipher) {
|
||||
return true
|
||||
}
|
||||
default:
|
||||
return false
|
||||
}
|
||||
return false
|
||||
}
|
||||
@@ -102,3 +122,20 @@ var vmessCipherList = []string{
|
||||
"chacha20-poly1305",
|
||||
"none",
|
||||
}
|
||||
|
||||
var ssCipherList = []string{
|
||||
"aes-128-gcm",
|
||||
"aes-192-gcm",
|
||||
"aes-256-gcm",
|
||||
"aes-128-cfb",
|
||||
"aes-192-cfb",
|
||||
"aes-256-cfb",
|
||||
"aes-128-ctr",
|
||||
"aes-192-ctr",
|
||||
"aes-256-ctr",
|
||||
"rc4-md5",
|
||||
"chacha20-ietf",
|
||||
"xchacha20",
|
||||
"chacha20-ietf-poly1305",
|
||||
"xchacha20-ietf-poly1305",
|
||||
}
|
||||
|
||||
40
provider/surge.go
Normal file
40
provider/surge.go
Normal file
@@ -0,0 +1,40 @@
|
||||
package provider
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/zu1k/proxypool/proxy"
|
||||
)
|
||||
|
||||
type Surge struct {
|
||||
Proxies proxy.ProxyList `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
|
||||
}
|
||||
@@ -8,21 +8,33 @@ type Base struct {
|
||||
UDP bool `yaml:"udp,omitempty" json:"udp,omitempty"`
|
||||
}
|
||||
|
||||
func (b *Base) TypeName() string {
|
||||
if b.Type == "" {
|
||||
return "unknown"
|
||||
}
|
||||
return b.Type
|
||||
}
|
||||
|
||||
func (b *Base) SetName(name string) {
|
||||
b.Name = name
|
||||
}
|
||||
|
||||
func (b *Base) BaseInfo() *Base {
|
||||
return b
|
||||
}
|
||||
|
||||
func (b *Base) Clone() Base {
|
||||
c := *b
|
||||
return c
|
||||
}
|
||||
|
||||
type Proxy interface {
|
||||
String() string
|
||||
ToClash() string
|
||||
ToSurge() string
|
||||
Identifier() string
|
||||
SetName(name string)
|
||||
}
|
||||
|
||||
func Deduplication(src []Proxy) []Proxy {
|
||||
result := make([]Proxy, 0, len(src))
|
||||
temp := map[string]struct{}{}
|
||||
for _, item := range src {
|
||||
if _, ok := temp[item.Identifier()]; !ok {
|
||||
temp[item.Identifier()] = struct{}{}
|
||||
result = append(result, item)
|
||||
}
|
||||
}
|
||||
return result
|
||||
TypeName() string
|
||||
BaseInfo() *Base
|
||||
Clone() Proxy
|
||||
}
|
||||
|
||||
79
proxy/check.go
Normal file
79
proxy/check.go
Normal file
@@ -0,0 +1,79 @@
|
||||
package proxy
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/Dreamacro/clash/adapters/outbound"
|
||||
)
|
||||
|
||||
const defaultURLTestTimeout = time.Second * 5
|
||||
|
||||
func testDelay(p 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.TypeName() == "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 CleanBadProxies(proxies []Proxy) (cproxies []Proxy) {
|
||||
c := make(chan checkResult, 40)
|
||||
defer close(c)
|
||||
for _, p := range proxies {
|
||||
go testProxyDelayToChan(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, 0)
|
||||
for _, p := range proxies {
|
||||
if _, ok := okMap[p.Identifier()]; ok {
|
||||
cproxies = append(cproxies, p.Clone())
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
type checkResult struct {
|
||||
name string
|
||||
delay uint16
|
||||
}
|
||||
|
||||
func testProxyDelayToChan(p Proxy, c chan checkResult) {
|
||||
delay, err := testDelay(p)
|
||||
if err != nil {
|
||||
c <- checkResult{
|
||||
name: p.Identifier(),
|
||||
delay: 0,
|
||||
}
|
||||
return
|
||||
}
|
||||
c <- checkResult{
|
||||
name: p.Identifier(),
|
||||
delay: delay,
|
||||
}
|
||||
}
|
||||
51
proxy/geoip.go
Normal file
51
proxy/geoip.go
Normal file
@@ -0,0 +1,51 @@
|
||||
package proxy
|
||||
|
||||
import (
|
||||
"log"
|
||||
"net"
|
||||
"os"
|
||||
|
||||
"github.com/oschwald/geoip2-golang"
|
||||
)
|
||||
|
||||
var geoIp GeoIP
|
||||
|
||||
func InitGeoIpDB() {
|
||||
geoIp = NewGeoIP("assets/GeoLite2-City.mmdb")
|
||||
}
|
||||
|
||||
// GeoIP2
|
||||
type GeoIP struct {
|
||||
db *geoip2.Reader
|
||||
}
|
||||
|
||||
// new geoip from db file
|
||||
func NewGeoIP(filePath string) (geoip GeoIP) {
|
||||
// 判断文件是否存在
|
||||
_, err := os.Stat(filePath)
|
||||
if err != nil && os.IsNotExist(err) {
|
||||
log.Println("文件不存在,请自行下载 Geoip2 City库,并保存在", filePath)
|
||||
os.Exit(1)
|
||||
} else {
|
||||
db, err := geoip2.Open(filePath)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
geoip = GeoIP{db: db}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// find ip info
|
||||
func (g GeoIP) Find(ipORdomain string) (country string, err error) {
|
||||
ips, err := net.LookupIP(ipORdomain)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
ipData := net.ParseIP(ips[0].String())
|
||||
record, err := g.db.City(ipData)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return record.Country.IsoCode, nil
|
||||
}
|
||||
83
proxy/proxies.go
Normal file
83
proxy/proxies.go
Normal file
@@ -0,0 +1,83 @@
|
||||
package proxy
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sort"
|
||||
)
|
||||
|
||||
type ProxyList []Proxy
|
||||
|
||||
func (ps ProxyList) Len() int {
|
||||
return len(ps)
|
||||
}
|
||||
|
||||
func (ps ProxyList) Less(i, j int) bool {
|
||||
return ps[i].BaseInfo().Name < ps[j].BaseInfo().Name
|
||||
}
|
||||
|
||||
func (ps ProxyList) Swap(i, j int) {
|
||||
ps[i], ps[j] = ps[j], ps[i]
|
||||
}
|
||||
|
||||
func (ps ProxyList) Deduplication() ProxyList {
|
||||
result := make(ProxyList, 0, len(ps))
|
||||
temp := map[string]struct{}{}
|
||||
for _, item := range ps {
|
||||
if item != nil {
|
||||
if _, ok := temp[item.Identifier()]; !ok {
|
||||
temp[item.Identifier()] = struct{}{}
|
||||
result = append(result, item)
|
||||
}
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
func (ps ProxyList) Sort() ProxyList {
|
||||
sort.Sort(ps)
|
||||
return ps
|
||||
}
|
||||
|
||||
func (ps ProxyList) NameAddCounrty() ProxyList {
|
||||
num := len(ps)
|
||||
for i := 0; i < num; i++ {
|
||||
country, err := geoIp.Find(ps[i].BaseInfo().Server)
|
||||
if err != nil || country == "" {
|
||||
country = "Earth"
|
||||
}
|
||||
ps[i].SetName(fmt.Sprintf("%s", country))
|
||||
}
|
||||
return ps
|
||||
}
|
||||
|
||||
func (ps ProxyList) NameAddIndex() ProxyList {
|
||||
num := len(ps)
|
||||
for i := 0; i < num; i++ {
|
||||
ps[i].SetName(fmt.Sprintf("%s_%d", ps[i].BaseInfo().Name, i+1))
|
||||
}
|
||||
return ps
|
||||
}
|
||||
|
||||
func Deduplication(src ProxyList) ProxyList {
|
||||
result := make(ProxyList, 0, len(src))
|
||||
temp := map[string]struct{}{}
|
||||
for _, item := range src {
|
||||
if item != nil {
|
||||
if _, ok := temp[item.Identifier()]; !ok {
|
||||
temp[item.Identifier()] = struct{}{}
|
||||
result = append(result, item)
|
||||
}
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
func (ps ProxyList) Clone() ProxyList {
|
||||
result := make(ProxyList, 0, len(ps))
|
||||
for _, pp := range ps {
|
||||
if pp != nil {
|
||||
result = append(result, pp.Clone())
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
155
proxy/shadowsocks.go
Normal file
155
proxy/shadowsocks.go
Normal file
@@ -0,0 +1,155 @@
|
||||
package proxy
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"net"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/zu1k/proxypool/tool"
|
||||
)
|
||||
|
||||
var (
|
||||
ErrorNotSSLink = errors.New("not a correct ss link")
|
||||
)
|
||||
|
||||
type Shadowsocks struct {
|
||||
Base
|
||||
Password string `yaml:"password" json:"password"`
|
||||
Cipher string `yaml:"cipher" json:"cipher"`
|
||||
Plugin string `yaml:"plugin,omitempty" json:"plugin,omitempty"`
|
||||
PluginOpts map[string]interface{} `yaml:"plugin-opts,omitempty" json:"plugin-opts,omitempty"`
|
||||
}
|
||||
|
||||
func (ss Shadowsocks) Identifier() string {
|
||||
return net.JoinHostPort(ss.Server, strconv.Itoa(ss.Port)) + ss.Password
|
||||
}
|
||||
|
||||
func (ss Shadowsocks) String() string {
|
||||
data, err := json.Marshal(ss)
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
return string(data)
|
||||
}
|
||||
|
||||
func (ss Shadowsocks) ToClash() string {
|
||||
data, err := json.Marshal(ss)
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
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) Clone() Proxy {
|
||||
return &ss
|
||||
}
|
||||
|
||||
func ParseSSLink(link string) (*Shadowsocks, error) {
|
||||
if !strings.HasPrefix(link, "ss://") {
|
||||
return nil, ErrorNotSSRLink
|
||||
}
|
||||
|
||||
uri, err := url.Parse(link)
|
||||
if err != nil {
|
||||
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())
|
||||
|
||||
moreInfos := uri.Query()
|
||||
pluginString := moreInfos.Get("plugin")
|
||||
plugin := ""
|
||||
pluginOpts := make(map[string]interface{})
|
||||
if strings.Contains(pluginString, ";") {
|
||||
pluginInfos, err := url.ParseQuery(pluginString)
|
||||
if err == nil {
|
||||
if strings.Contains(pluginString, "obfs") {
|
||||
plugin = "obfs"
|
||||
pluginOpts["mode"] = pluginInfos.Get("obfs")
|
||||
pluginOpts["host"] = pluginInfos.Get("obfs-host")
|
||||
} else if strings.Contains(pluginString, "v2ray") {
|
||||
plugin = "v2ray-plugin"
|
||||
pluginOpts["mode"] = pluginInfos.Get("mode")
|
||||
pluginOpts["host"] = pluginInfos.Get("host")
|
||||
pluginOpts["tls"] = strings.Contains(pluginString, "tls")
|
||||
}
|
||||
}
|
||||
}
|
||||
if port == 0 || cipher == "" {
|
||||
return nil, ErrorNotSSLink
|
||||
}
|
||||
|
||||
return &Shadowsocks{
|
||||
Base: Base{
|
||||
Name: strconv.Itoa(rand.Int()),
|
||||
Server: server,
|
||||
Port: port,
|
||||
Type: "ss",
|
||||
},
|
||||
Password: password,
|
||||
Cipher: cipher,
|
||||
Plugin: plugin,
|
||||
PluginOpts: pluginOpts,
|
||||
}, nil
|
||||
}
|
||||
|
||||
var (
|
||||
ssPlainRe = regexp.MustCompile("ss://([A-Za-z0-9+/_&?=@:%.-])+")
|
||||
)
|
||||
|
||||
func GrepSSLinkFromString(text string) []string {
|
||||
results := make([]string, 0)
|
||||
texts := strings.Split(text, "ss://")
|
||||
for _, text := range texts {
|
||||
results = append(results, ssPlainRe.FindAllString("ss://"+text, -1)...)
|
||||
}
|
||||
return results
|
||||
}
|
||||
@@ -53,8 +53,12 @@ func (ssr ShadowsocksR) ToClash() string {
|
||||
return "- " + string(data)
|
||||
}
|
||||
|
||||
func (ssr *ShadowsocksR) SetName(name string) {
|
||||
ssr.Name = name
|
||||
func (ssr ShadowsocksR) ToSurge() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (ssr ShadowsocksR) Clone() Proxy {
|
||||
return &ssr
|
||||
}
|
||||
|
||||
func ParseSSRLink(link string) (*ShadowsocksR, error) {
|
||||
|
||||
@@ -40,7 +40,7 @@ type HTTPOptions struct {
|
||||
}
|
||||
|
||||
func (v Vmess) Identifier() string {
|
||||
return net.JoinHostPort(v.Server, strconv.Itoa(v.Port)) + v.Cipher
|
||||
return net.JoinHostPort(v.Server, strconv.Itoa(v.Port)) + v.Cipher + v.UUID
|
||||
}
|
||||
|
||||
func (v Vmess) String() string {
|
||||
@@ -59,8 +59,31 @@ func (v Vmess) ToClash() string {
|
||||
return "- " + string(data)
|
||||
}
|
||||
|
||||
func (v *Vmess) SetName(name string) {
|
||||
v.Name = name
|
||||
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) Clone() Proxy {
|
||||
return &v
|
||||
}
|
||||
|
||||
type vmessLinkJson struct {
|
||||
@@ -103,7 +126,6 @@ func ParseVmessLink(link string) (*Vmess, error) {
|
||||
if err != nil {
|
||||
return nil, ErrorVmessPayloadParseFail
|
||||
}
|
||||
fmt.Println(baseInfo)
|
||||
baseInfoPath := strings.Split(baseInfo, ":")
|
||||
if len(baseInfoPath) < 3 {
|
||||
return nil, ErrorPathNotComplete
|
||||
@@ -123,7 +145,6 @@ func ParseVmessLink(link string) (*Vmess, error) {
|
||||
}
|
||||
|
||||
moreInfo, _ := url.ParseQuery(infoPayloads[1])
|
||||
fmt.Println(moreInfo)
|
||||
remarks := moreInfo.Get("remarks")
|
||||
obfs := moreInfo.Get("obfs")
|
||||
network := "tcp"
|
||||
@@ -132,6 +153,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)
|
||||
@@ -179,8 +203,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()),
|
||||
@@ -204,7 +233,7 @@ func ParseVmessLink(link string) (*Vmess, error) {
|
||||
}
|
||||
|
||||
var (
|
||||
vmessPlainRe = regexp.MustCompile("vmess://([A-Za-z0-9+/_-])+")
|
||||
vmessPlainRe = regexp.MustCompile("vmess://([A-Za-z0-9+/_?&=-])+")
|
||||
)
|
||||
|
||||
func GrepVmessLinkFromString(text string) []string {
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
package proxy
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestParseVmessLink(t *testing.T) {
|
||||
//link := "vmess://YXV0bzo5MGQ0YTM3NC1kYWU4LTExZWEtODY3Zi01NjAwMDJlY2MzNDlAZml2ZWRlbWFuZHMubWw6NDQz?remarks=%E6%97%A5%E6%9C%AC5%EF%BC%9A%E7%94%B5%E6%8A%A5%E9%A2%91%E9%81%93%EF%BC%9A"
|
||||
|
||||
link := "vmess://ew0KICAidiI6ICIyIiwNCiAgInBzIjogIkBTU1JTVUItVjI5LeS7mOi0ueaOqOiNkDp0LmNuL0VHSkl5cmwiLA0KICAiYWRkIjogImJ1cmdlcmtpbmdnb29kLm1sIiwNCiAgInBvcnQiOiAiNDQzIiwNCiAgImlkIjogIjRiNWJhMzkwLWRhZjQtMTFlYS04ODEwLTU2MDAwMmVjYzk2NyIsDQogICJhaWQiOiAiNDYiLA0KICAibmV0IjogIndzIiwNCiAgInR5cGUiOiAibm9uZSIsDQogICJob3N0IjogImJ1cmdlcmtpbmdnb29kLm1sIiwNCiAgInBhdGgiOiAiL0M2bGt2UzNLLyIsDQogICJ0bHMiOiAidGxzIg0KfQ=="
|
||||
fmt.Println(ParseVmessLink(link))
|
||||
}
|
||||
313
source.yaml
Normal file
313
source.yaml
Normal file
@@ -0,0 +1,313 @@
|
||||
sources:
|
||||
- type: webfuzzsub
|
||||
options:
|
||||
url: https://raw.githubusercontent.com/du5/free/master/sub.list
|
||||
# 订阅链接
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://suda.sub.koicloud.pw/link/K9vz0uFPe9ULfdqX?sub=3
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://raw.githubusercontent.com/Pcrab/Dotfiles/912c1104b3f8121f72f7ee11590f52bc9c44dde7/.config/electron-ssr/gui-config.json
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://v2.fit/modules/servers/V2raySocks/osubscribe.php?sid=7063&token=lKJwbO2onxIr
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://www.liesauer.net/yogurt/subscribe?ACCESS_TOKEN=d309c6921bbd7d0d
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://neurotoxinw.coding.net/p/qifei/d/qifei/git/raw/master/README.md
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://sbnmsl.co/link/2cpTGUGJtHBXUK7d?sub=3
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://extrm.info/link/uirPjznB7esOezjr?sub=1
|
||||
- type: subscribe
|
||||
options:
|
||||
url: http://www.sksla.pro/api/v1/client/subscribe?token=99c3fa86424539bd3bd34a893bc6dee8
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://vvsub.xyz/api/al/19786-xDX1SCq61Ymi
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://rss-node.com/link/vqOaWFJRfbYxpAhY?mu=1
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://tm2w.live/link/EqICUlKXmn1EJwaw?sub=3
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://dingyue.suying666.info/link/o7j43Aykx8CWBehE?sub=3
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://dingyue.suying666.info/link/o7j43Aykx8CWBehE?sub=1
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://www.haidaobot.xyz/link/QwdUmWolPN0LkThW?mu=2
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://pptp.cloud/sub/cXHG9wqUpQbhHr7b.html
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://suda.sub.koicloud.pw/link/JgULLCNkImsJ6Ibh?sub=3
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://jiyou.world/modules/servers/V2raySocks/osubscribetest.php?sid=57394&token=V3GM60lgqZL9
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://aero.moe/link/kxdbKdopH3paUqUf?sub=3
|
||||
- type: subscribe
|
||||
options:
|
||||
url: http://dy.tntv2.xyz/link/pTL0RgiVblXLIQjS?sub=3&extend=1
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://719401146.online//link/oHPA3bXVc2zeqGGq?mu=2
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://www.v2ray.pw/link/b5e255KbnnATXc60?mu=2+&extend=1
|
||||
- type: subscribe
|
||||
options:
|
||||
url: http://ssrdingyue.ueuo.com/v2/8y12r
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://www.suncloud.fun/link/Su683BQEyUdxtyuY?mu=1&extend=1
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://sub88.xyz/link/egy4oyqok9aavpcy?sub=3
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://qiaomenzhuanfx.netlify.com/
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://sub88.xyz/link/lkY8Jt5Q3SHlffra?mu=2
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://raw.githubusercontent.com/hotsymbol/vpnsetting/master/v2rayopen
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://raw.githubusercontent.com/satrom/V2SSR/master/V2RAY/Sub.txt
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://raw.githubusercontent.com/ssrsub/ssr/master/v2ray
|
||||
- type: subscribe
|
||||
options:
|
||||
url: http://qe83xk711.sabkt.gdipper.com/freev2ray.txt
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://iwxf.netlify.app/
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://rss.getfree.win/link/w9ted9eZq1zbC3gx?sub=1
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://youlianboshi.netlify.com/
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://raw.githubusercontent.com/ssrsub/ssr/master/ss-sub
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://bujidao302.com/link/IJ6wKEt96Otboilb?mu=2
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://raw.githubusercontent.com/satrom/V2SSR/master/SSR/Day.txt
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://raw.githubusercontent.com/ntkernel/lantern/master/vmess_base64.txt
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://lei-su.me//link/Dw3lmyXXJJTnvsBA?sub=3&extend=1
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://raw.githubusercontent.com/cdp2020/v2ray/master/README.md
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://raw.githubusercontent.com/ssrsub/ssr/master/ssrsub
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://www.liesauer.net/yogurt/subscribe?ACCESS_TOKEN=DAYxR3mMaZAsaqUb
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://rss.cnrss.xyz/link/Rcr8h8fvZIWE001U?mu=2
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://12o.ooo/link/JLisT80gOhRkiFnX?sub=1
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://sub1.m87sub.xyz/link/pZDgnxhgL6Poh1GQ?sub=3
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://raw.githubusercontent.com/satrom/V2SSR/master/SSR/Sub.txt
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://sub88.xyz/link/lkY8Jt5Q3SHlffra?mu=2
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://s.sublank.xyz/subscribe/66056/0yzuMVawjpr/ssr/
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://sub1.m87sub.xyz/link/pZDgnxhgL6Poh1GQ?sub=1
|
||||
- type: subscribe
|
||||
options:
|
||||
url: http://qe83xk711.sabkt.gdipper.com/freess.txt
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://raw.githubusercontent.com/pojiezhiyuanjun/freev2/master/20200808.txt
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://sub1.m87sub.xyz/link/2488O6IM4n4nksMG?sub=3
|
||||
- type: subscribe
|
||||
options:
|
||||
url: http://103.72.166.89/v2ray.php
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://fly.lo-lita.ru/api/v1/client/subscribe?token=94be7fa3d65791197dd10c6a0b757571
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://raw.githubusercontent.com/RaymondHarris971/ssrsub/master/9a075bdee5.txt
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://bit.ly/2D5fWhX
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://www.suncloud.fun/link/ja3OIcMTrky6VhN6?mu=1&extend=1
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://raw.githubusercontent.com/voken100g/AutoSSR/master/recent
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://jiang.netlify.com/
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://raw.githubusercontent.com/ssrsub/ssr/master/v2ray
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://raw.githubusercontent.com/ssrsub/ssr/master/ssrsub
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://raw.githubusercontent.com/ssrsub/ssr/master/ss-sub
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://heikejilaila.xyz/keji.php?id=22c7b9fdda20bb7405b270cd75971f66
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://youlianboshi.netlify.app/
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://raw.githubusercontent.com/umelabs/node.umelabs.dev/master/Subscribe/SS.md
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://raw.githubusercontent.com/umelabs/node.umelabs.dev/master/Subscribe/SSR.md
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://raw.githubusercontent.com/umelabs/node.umelabs.dev/master/Subscribe/v2ray.md
|
||||
- type: subscribe
|
||||
options:
|
||||
url: https://www.3kla.cn/subscribe/txt/Anranray.txt
|
||||
|
||||
# 网页模糊抓取
|
||||
- type: webfuzz
|
||||
options:
|
||||
url: https://zfjvpn.gitbook.io/
|
||||
- type: webfuzz
|
||||
options:
|
||||
url: https://www.freefq.com/d/file/free-ssr/20200811/1f3e9d0d0064f662457062712dcf1b66.txt
|
||||
- type: webfuzz
|
||||
options:
|
||||
url: https://merlinblog.xyz/wiki/freess.html
|
||||
- type: webfuzz
|
||||
options:
|
||||
url: https://zfjvpn.gitbook.io/123/
|
||||
- type: webfuzz
|
||||
options:
|
||||
url: https://raw.githubusercontent.com/ruanfei/ShadowsocksRRShare/master/ss/ss.txt
|
||||
- type: webfuzz
|
||||
options:
|
||||
url: https://raw.githubusercontent.com/ruanfei/ShadowsocksRRShare/master/ssr/ssr.txt
|
||||
- type: webfuzz
|
||||
options:
|
||||
url: https://raw.githubusercontent.com/pojiezhiyuanjun/freev2/master/all.txt
|
||||
- type: webfuzz
|
||||
options:
|
||||
url: https://raw.githubusercontent.com/zu1k/ssrtool-crawler/master/data/ssr.txt
|
||||
- type: webfuzz
|
||||
options:
|
||||
url: https://raw.githubusercontent.com/freefq/free/master/README.md
|
||||
- type: webfuzz
|
||||
options:
|
||||
url: https://raw.githubusercontent.com/52bp/52bp.github.io/master/freesite.html
|
||||
|
||||
# tg频道
|
||||
- type: tgchannel
|
||||
options:
|
||||
channel: ssrList
|
||||
num: 200
|
||||
- type: tgchannel
|
||||
options:
|
||||
channel: ssList
|
||||
num: 200
|
||||
- type: tgchannel
|
||||
options:
|
||||
channel: SSRSUB
|
||||
num: 200
|
||||
- type: tgchannel
|
||||
options:
|
||||
channel: FreeSSRNode
|
||||
num: 200
|
||||
- type: tgchannel
|
||||
options:
|
||||
channel: ssrlists
|
||||
num: 200
|
||||
- type: tgchannel
|
||||
options:
|
||||
channel: ssrshares
|
||||
num: 200
|
||||
- type: tgchannel
|
||||
options:
|
||||
channel: V2List
|
||||
num: 200
|
||||
- type: tgchannel
|
||||
options:
|
||||
channel: ssrtool
|
||||
num: 100
|
||||
- type: tgchannel
|
||||
options:
|
||||
channel: ssrtool_crack
|
||||
num: 100
|
||||
- type: tgchannel
|
||||
options:
|
||||
channel: vmessr
|
||||
num: 200
|
||||
- type: tgchannel
|
||||
options:
|
||||
channel: FreeSSR666
|
||||
num: 200
|
||||
- type: tgchannel
|
||||
options:
|
||||
channel: fanqiang666
|
||||
num: 200
|
||||
- type: tgchannel
|
||||
options:
|
||||
channel: jiedianfenxiang
|
||||
num: 200
|
||||
- type: tgchannel
|
||||
options:
|
||||
channel: freeshadowsock
|
||||
num: 200
|
||||
|
||||
# 翻墙党,后面的东西都无需修改
|
||||
- type: web-fanqiangdang
|
||||
options:
|
||||
url: https://fanqiangdang.com/forum.php?mod=rss&fid=50&auth=0
|
||||
num: 200
|
||||
- type: web-fanqiangdang
|
||||
options:
|
||||
url: https://fanqiangdang.com/forum.php?mod=rss&fid=2&auth=0
|
||||
num: 200
|
||||
- type: web-fanqiangdang
|
||||
options:
|
||||
url: https://fanqiangdang.com/forum.php?mod=rss&fid=36&auth=0
|
||||
num: 200
|
||||
|
||||
- type: web-freessrxyz
|
||||
options:
|
||||
43
tool/aes.go
43
tool/aes.go
@@ -1,43 +0,0 @@
|
||||
package tool
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/aes"
|
||||
)
|
||||
|
||||
func PKCS7Padding(ciphertext []byte, blockSize int) []byte {
|
||||
padding := blockSize - len(ciphertext)%blockSize
|
||||
padtext := bytes.Repeat([]byte{byte(padding)}, padding)
|
||||
return append(ciphertext, padtext...)
|
||||
}
|
||||
|
||||
func PKCS7UnPadding(origData []byte) []byte {
|
||||
length := len(origData)
|
||||
unpadding := int(origData[length-1])
|
||||
return origData[:(length - unpadding)]
|
||||
}
|
||||
|
||||
func AesEcbDecryptWithPKCS7Unpadding(data, key []byte) []byte {
|
||||
block, _ := aes.NewCipher(key)
|
||||
decrypted := make([]byte, len(data))
|
||||
size := block.BlockSize()
|
||||
|
||||
for bs, be := 0, size; bs < len(data); bs, be = bs+size, be+size {
|
||||
block.Decrypt(decrypted[bs:be], data[bs:be])
|
||||
}
|
||||
|
||||
return PKCS7UnPadding(decrypted)
|
||||
}
|
||||
|
||||
func AesEcbEncryptWithPKCS7Padding(data, key []byte) []byte {
|
||||
block, _ := aes.NewCipher(key)
|
||||
data = PKCS7Padding(data, block.BlockSize())
|
||||
decrypted := make([]byte, len(data))
|
||||
size := block.BlockSize()
|
||||
|
||||
for bs, be := 0, size; bs < len(data); bs, be = bs+size, be+size {
|
||||
block.Encrypt(decrypted[bs:be], data[bs:be])
|
||||
}
|
||||
|
||||
return decrypted
|
||||
}
|
||||
@@ -8,15 +8,8 @@ func Base64DecodeString(src string) (dst string, err error) {
|
||||
if src == "" {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
origin := src
|
||||
//if i := len(src) % 4; i != 0 {
|
||||
// for k := 0; k < i; k++ {
|
||||
// src += string(base64.StdPadding)
|
||||
// }
|
||||
//}
|
||||
var dstbytes []byte
|
||||
dstbytes, err = base64.RawURLEncoding.DecodeString(origin)
|
||||
dstbytes, err = base64.RawURLEncoding.DecodeString(src)
|
||||
|
||||
if err != nil {
|
||||
dstbytes, err = base64.RawStdEncoding.DecodeString(src)
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
package tool
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestBase64DecodeString(t *testing.T) {
|
||||
str := "OTEuMjA2LjkyLjM4OjI5MzE6b3JpZ2luOnJjNDpwbGFpbjpiRzVqYmk1dmNtY2dNak5zLz9vYmZzcGFyYW09JnJlbWFya3M9NTctNzVhS1o1WVdhWm1GdWNXbGhibWRrWVc1bkxtTnZiUSY9NUwtRTZMLWM1TGljUkEmZ3JvdXA9NTctNzVhS1o1WVdhWm1GdWNXbGhibWRrWVc1bkxtTnZiUSY9VEc1amJpNXZjbWM"
|
||||
fmt.Println(Base64DecodeString(str))
|
||||
fmt.Println(string([]byte(str)[232]))
|
||||
}
|
||||
@@ -1,18 +1,43 @@
|
||||
package tool
|
||||
|
||||
import (
|
||||
"io"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
var httpClient = http.DefaultClient
|
||||
|
||||
func init() {
|
||||
httpClient.Timeout = time.Second * 10
|
||||
http.DefaultClient.Timeout = time.Second * 10
|
||||
type HttpClient struct {
|
||||
*http.Client
|
||||
}
|
||||
|
||||
func GetHttpClient() *http.Client {
|
||||
var httpClient *HttpClient
|
||||
|
||||
func init() {
|
||||
httpClient = &HttpClient{http.DefaultClient}
|
||||
httpClient.Timeout = time.Second * 10
|
||||
}
|
||||
|
||||
func GetHttpClient() *HttpClient {
|
||||
c := *httpClient
|
||||
return &c
|
||||
}
|
||||
|
||||
func (c *HttpClient) Get(url string) (resp *http.Response, err error) {
|
||||
req, err := http.NewRequest(http.MethodGet, url, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
req.Header.Set("Accept-Language", "zh-CN,zh;q=0.9,en;q=0.8")
|
||||
req.Header.Set("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36")
|
||||
return c.Do(req)
|
||||
}
|
||||
|
||||
func (c *HttpClient) Post(url string, body io.Reader) (resp *http.Response, err error) {
|
||||
req, err := http.NewRequest(http.MethodPost, url, body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
req.Header.Set("Accept-Language", "zh-CN,zh;q=0.9,en;q=0.8")
|
||||
req.Header.Set("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36")
|
||||
return c.Do(req)
|
||||
}
|
||||
|
||||
3
tool/option.go
Normal file
3
tool/option.go
Normal file
@@ -0,0 +1,3 @@
|
||||
package tool
|
||||
|
||||
type Options map[string]interface{}
|
||||
Reference in New Issue
Block a user