变更包名
This commit is contained in:
26
README.md
26
README.md
@@ -30,7 +30,7 @@ GoProxy是一个功能强大的Go语言HTTP代理库,支持HTTP、HTTPS和WebS
|
|||||||
## 安装
|
## 安装
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
go get github.com/goproxy
|
go get github.com/darkit/goproxy
|
||||||
```
|
```
|
||||||
|
|
||||||
## 快速开始
|
## 快速开始
|
||||||
@@ -44,7 +44,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/goproxy/internal/proxy"
|
"github.com/darkit/goproxy/internal/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -68,8 +68,8 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/goproxy/internal/config"
|
"github.com/darkit/goproxy/internal/config"
|
||||||
"github.com/goproxy/internal/proxy"
|
"github.com/darkit/goproxy/internal/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -112,8 +112,8 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/goproxy/internal/config"
|
"github.com/darkit/goproxy/internal/config"
|
||||||
"github.com/goproxy/internal/proxy"
|
"github.com/darkit/goproxy/internal/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -163,7 +163,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/goproxy/internal/proxy"
|
"github.com/darkit/goproxy/internal/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -217,8 +217,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/goproxy/internal/metrics"
|
"github.com/darkit/goproxy/internal/metrics"
|
||||||
"github.com/goproxy/internal/proxy"
|
"github.com/darkit/goproxy/internal/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -279,8 +279,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/goproxy/internal/dns"
|
"github.com/darkit/goproxy/internal/dns"
|
||||||
"github.com/goproxy/internal/proxy"
|
"github.com/darkit/goproxy/internal/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -351,8 +351,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/goproxy/internal/dns"
|
"github.com/darkit/goproxy/internal/dns"
|
||||||
"github.com/goproxy/internal/proxy"
|
"github.com/darkit/goproxy/internal/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@@ -33,7 +33,7 @@
|
|||||||
确保已安装Go(建议1.22或更高版本):
|
确保已安装Go(建议1.22或更高版本):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/ouqiang/goproxy
|
git clone github.com/darkit/goproxy
|
||||||
cd goproxy
|
cd goproxy
|
||||||
go build ./...
|
go build ./...
|
||||||
```
|
```
|
||||||
@@ -127,7 +127,7 @@ go run cmd/wildcard_dns_proxy/main.go -hosts examples/wildcard_hosts.txt
|
|||||||
### 使用DNS解析器
|
### 使用DNS解析器
|
||||||
|
|
||||||
```go
|
```go
|
||||||
import "github.com/goproxy/internal/dns"
|
import "github.com/darkit/goproxy/internal/dns"
|
||||||
|
|
||||||
// 创建解析器
|
// 创建解析器
|
||||||
resolver := dns.NewResolver(
|
resolver := dns.NewResolver(
|
||||||
@@ -184,7 +184,7 @@ GoProxy支持三种负载均衡策略:
|
|||||||
### 使用DNS拨号器
|
### 使用DNS拨号器
|
||||||
|
|
||||||
```go
|
```go
|
||||||
import "github.com/goproxy/internal/dns"
|
import "github.com/darkit/goproxy/internal/dns"
|
||||||
|
|
||||||
// 创建解析器
|
// 创建解析器
|
||||||
resolver := dns.NewResolver(
|
resolver := dns.NewResolver(
|
||||||
|
@@ -6,9 +6,9 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/goproxy/internal/config"
|
"github.com/darkit/goproxy/internal/config"
|
||||||
"github.com/goproxy/internal/dns"
|
"github.com/darkit/goproxy/internal/dns"
|
||||||
"github.com/goproxy/internal/proxy"
|
"github.com/darkit/goproxy/internal/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
// CustomDNSDelegate HTTPS代理委托
|
// CustomDNSDelegate HTTPS代理委托
|
||||||
|
@@ -6,9 +6,9 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/goproxy/internal/config"
|
"github.com/darkit/goproxy/internal/config"
|
||||||
"github.com/goproxy/internal/dns"
|
"github.com/darkit/goproxy/internal/dns"
|
||||||
"github.com/goproxy/internal/proxy"
|
"github.com/darkit/goproxy/internal/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
// CustomDNSDelegate 自定义DNS委托
|
// CustomDNSDelegate 自定义DNS委托
|
||||||
|
@@ -6,9 +6,9 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/goproxy/internal/config"
|
"github.com/darkit/goproxy/internal/config"
|
||||||
"github.com/goproxy/internal/dns"
|
"github.com/darkit/goproxy/internal/dns"
|
||||||
"github.com/goproxy/internal/proxy"
|
"github.com/darkit/goproxy/internal/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
// CustomPortDelegate 自定义端口委托
|
// CustomPortDelegate 自定义端口委托
|
||||||
|
@@ -10,12 +10,12 @@ import (
|
|||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/goproxy/internal/cache"
|
"github.com/darkit/goproxy/internal/cache"
|
||||||
"github.com/goproxy/internal/config"
|
"github.com/darkit/goproxy/internal/config"
|
||||||
"github.com/goproxy/internal/healthcheck"
|
"github.com/darkit/goproxy/internal/healthcheck"
|
||||||
"github.com/goproxy/internal/loadbalance"
|
"github.com/darkit/goproxy/internal/loadbalance"
|
||||||
"github.com/goproxy/internal/metrics"
|
"github.com/darkit/goproxy/internal/metrics"
|
||||||
"github.com/goproxy/internal/proxy"
|
"github.com/darkit/goproxy/internal/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@@ -6,8 +6,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/goproxy/internal/config"
|
"github.com/darkit/goproxy/internal/config"
|
||||||
"github.com/goproxy/internal/proxy"
|
"github.com/darkit/goproxy/internal/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
// CustomDelegate 自定义委托,用于HTTP到HTTPS代理
|
// CustomDelegate 自定义委托,用于HTTP到HTTPS代理
|
||||||
|
@@ -7,8 +7,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/goproxy/internal/config"
|
"github.com/darkit/goproxy/internal/config"
|
||||||
"github.com/goproxy/internal/proxy"
|
"github.com/darkit/goproxy/internal/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
// 自定义委托,用于HTTPS到HTTPS代理
|
// 自定义委托,用于HTTPS到HTTPS代理
|
||||||
|
@@ -10,9 +10,9 @@ import (
|
|||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/goproxy/internal/config"
|
"github.com/darkit/goproxy/internal/config"
|
||||||
"github.com/goproxy/internal/metrics"
|
"github.com/darkit/goproxy/internal/metrics"
|
||||||
"github.com/goproxy/internal/proxy"
|
"github.com/darkit/goproxy/internal/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@@ -6,9 +6,9 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/goproxy/internal/config"
|
"github.com/darkit/goproxy/internal/config"
|
||||||
"github.com/goproxy/internal/dns"
|
"github.com/darkit/goproxy/internal/dns"
|
||||||
"github.com/goproxy/internal/proxy"
|
"github.com/darkit/goproxy/internal/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
// WildcardDNSDelegate 带有泛解析功能的委托
|
// WildcardDNSDelegate 带有泛解析功能的委托
|
||||||
|
2
go.mod
2
go.mod
@@ -1,4 +1,4 @@
|
|||||||
module github.com/goproxy
|
module github.com/darkit/goproxy
|
||||||
|
|
||||||
go 1.24.0
|
go 1.24.0
|
||||||
|
|
||||||
|
@@ -5,11 +5,11 @@ import (
|
|||||||
"net/http/httptrace"
|
"net/http/httptrace"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/goproxy/internal/cache"
|
"github.com/darkit/goproxy/internal/cache"
|
||||||
"github.com/goproxy/internal/config"
|
"github.com/darkit/goproxy/internal/config"
|
||||||
"github.com/goproxy/internal/healthcheck"
|
"github.com/darkit/goproxy/internal/healthcheck"
|
||||||
"github.com/goproxy/internal/loadbalance"
|
"github.com/darkit/goproxy/internal/loadbalance"
|
||||||
"github.com/goproxy/internal/metrics"
|
"github.com/darkit/goproxy/internal/metrics"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Option 用于配置代理选项的函数类型
|
// Option 用于配置代理选项的函数类型
|
||||||
|
@@ -17,12 +17,12 @@ import (
|
|||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/goproxy/internal/cache"
|
"github.com/darkit/goproxy/internal/cache"
|
||||||
"github.com/goproxy/internal/config"
|
"github.com/darkit/goproxy/internal/config"
|
||||||
"github.com/goproxy/internal/healthcheck"
|
"github.com/darkit/goproxy/internal/healthcheck"
|
||||||
"github.com/goproxy/internal/loadbalance"
|
"github.com/darkit/goproxy/internal/loadbalance"
|
||||||
"github.com/goproxy/internal/metrics"
|
"github.com/darkit/goproxy/internal/metrics"
|
||||||
"github.com/goproxy/internal/middleware"
|
"github.com/darkit/goproxy/internal/middleware"
|
||||||
"github.com/ouqiang/websocket"
|
"github.com/ouqiang/websocket"
|
||||||
"github.com/viki-org/dnscache"
|
"github.com/viki-org/dnscache"
|
||||||
)
|
)
|
||||||
|
@@ -11,8 +11,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/goproxy/internal/rewriter"
|
"github.com/darkit/goproxy/internal/rewriter"
|
||||||
"github.com/goproxy/internal/router"
|
"github.com/darkit/goproxy/internal/router"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ReverseProxy 反向代理
|
// ReverseProxy 反向代理
|
||||||
|
@@ -1,14 +0,0 @@
|
|||||||
-----BEGIN CERTIFICATE-----
|
|
||||||
MIICJzCCAcygAwIBAgIITWWCIQf8/VIwCgYIKoZIzj0EAwIwUzEOMAwGA1UEBhMF
|
|
||||||
Q2hpbmExDzANBgNVBAgTBkZ1SmlhbjEPMA0GA1UEBxMGWGlhbWVuMRAwDgYDVQQK
|
|
||||||
EwdHb3Byb3h5MQ0wCwYDVQQDEwRNYXJzMB4XDTIyMDMyNTA1NDgwMFoXDTQyMDQy
|
|
||||||
NTA1NDgwMFowUzEOMAwGA1UEBhMFQ2hpbmExDzANBgNVBAgTBkZ1SmlhbjEPMA0G
|
|
||||||
A1UEBxMGWGlhbWVuMRAwDgYDVQQKEwdHb3Byb3h5MQ0wCwYDVQQDEwRNYXJzMFkw
|
|
||||||
EwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEf0mhVJmuTmxnLimKshdEE4+PYdxvBfQX
|
|
||||||
mRgsFV5KHHmxOrVJBFC/nDetmGowkARShWtBsX1Irm4w6i6Qk2QliKOBiTCBhjAO
|
|
||||||
BgNVHQ8BAf8EBAMCAQYwHQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUFBwMBMBIG
|
|
||||||
A1UdEwEB/wQIMAYBAf8CAQIwHQYDVR0OBBYEFBI5TkWYcvUIWsBAdffs833FnBrI
|
|
||||||
MCIGA1UdEQQbMBmBF3FpbmdxaWFubHVkYW9AZ21haWwuY29tMAoGCCqGSM49BAMC
|
|
||||||
A0kAMEYCIQCk1DhW7AmIW/n/QLftQq8BHZKLevWYJ813zdrNr5kXlwIhAIVvqglY
|
|
||||||
9BkYWg4NEe/mVO4C5Vtu4FnzNU9I+rFpXVSO
|
|
||||||
-----END CERTIFICATE-----
|
|
Reference in New Issue
Block a user