chore: update deps
This commit is contained in:
parent
a9b85c6495
commit
f4bccb0e96
8
dns.go
8
dns.go
@ -3,7 +3,8 @@ package main
|
|||||||
import "github.com/fumiama/terasu/dns"
|
import "github.com/fumiama/terasu/dns"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
dns.IPv4Servers.Add(map[string][]string{
|
dns.IPv4Servers.Add(&dns.DNSConfig{
|
||||||
|
Servers: map[string][]string{
|
||||||
"dot.360.cn": {
|
"dot.360.cn": {
|
||||||
"101.198.192.33:853",
|
"101.198.192.33:853",
|
||||||
"112.65.69.15:853",
|
"112.65.69.15:853",
|
||||||
@ -12,8 +13,10 @@ func init() {
|
|||||||
"123.125.81.6:853",
|
"123.125.81.6:853",
|
||||||
"140.207.198.6:853",
|
"140.207.198.6:853",
|
||||||
},
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
dns.IPv6Servers.Add(map[string][]string{
|
dns.IPv6Servers.Add(&dns.DNSConfig{
|
||||||
|
Servers: map[string][]string{
|
||||||
"dot.360.cn": {
|
"dot.360.cn": {
|
||||||
"101.198.192.33:853",
|
"101.198.192.33:853",
|
||||||
"112.65.69.15:853",
|
"112.65.69.15:853",
|
||||||
@ -22,5 +25,6 @@ func init() {
|
|||||||
"123.125.81.6:853",
|
"123.125.81.6:853",
|
||||||
"140.207.198.6:853",
|
"140.207.198.6:853",
|
||||||
},
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
2
go.mod
2
go.mod
@ -2,7 +2,7 @@ module comandy
|
|||||||
|
|
||||||
go 1.22.1
|
go 1.22.1
|
||||||
|
|
||||||
require github.com/fumiama/terasu v0.0.0-20240418161858-1c3273a78268
|
require github.com/fumiama/terasu v0.0.0-20240502091919-c887e26289a8
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/FloatTech/ttl v0.0.0-20230307105452-d6f7b2b647d1 // indirect
|
github.com/FloatTech/ttl v0.0.0-20230307105452-d6f7b2b647d1 // indirect
|
||||||
|
2
go.sum
2
go.sum
@ -8,6 +8,8 @@ github.com/fumiama/terasu v0.0.0-20240418160715-5999fcf7db84 h1:dQ4GUL1OHOHHlZ0S
|
|||||||
github.com/fumiama/terasu v0.0.0-20240418160715-5999fcf7db84/go.mod h1:afchyfKAb7J/zvaENtYzjIEPVbwiEjJaow05zzT4usM=
|
github.com/fumiama/terasu v0.0.0-20240418160715-5999fcf7db84/go.mod h1:afchyfKAb7J/zvaENtYzjIEPVbwiEjJaow05zzT4usM=
|
||||||
github.com/fumiama/terasu v0.0.0-20240418161858-1c3273a78268 h1:6R8kSGVSIoR3xm2NG8Z4ivkTpAET783RFsJOVKrI7n8=
|
github.com/fumiama/terasu v0.0.0-20240418161858-1c3273a78268 h1:6R8kSGVSIoR3xm2NG8Z4ivkTpAET783RFsJOVKrI7n8=
|
||||||
github.com/fumiama/terasu v0.0.0-20240418161858-1c3273a78268/go.mod h1:afchyfKAb7J/zvaENtYzjIEPVbwiEjJaow05zzT4usM=
|
github.com/fumiama/terasu v0.0.0-20240418161858-1c3273a78268/go.mod h1:afchyfKAb7J/zvaENtYzjIEPVbwiEjJaow05zzT4usM=
|
||||||
|
github.com/fumiama/terasu v0.0.0-20240502091919-c887e26289a8 h1:mVOgOhlrF0ra8/BkwVA71ev/1HkzAgDn8gWU2UNbDU8=
|
||||||
|
github.com/fumiama/terasu v0.0.0-20240502091919-c887e26289a8/go.mod h1:UVx8YP1jKKL1Cj+uy+OnQRM2Ih6U36Mqy9GSf7jabsI=
|
||||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
|
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
|
||||||
|
@ -19,7 +19,8 @@ type testlist struct {
|
|||||||
func TestRequest(t *testing.T) {
|
func TestRequest(t *testing.T) {
|
||||||
(*testlist)(unsafe.Pointer(&dns.IPv4Servers)).m = make(map[string][]*uintptr)
|
(*testlist)(unsafe.Pointer(&dns.IPv4Servers)).m = make(map[string][]*uintptr)
|
||||||
(*testlist)(unsafe.Pointer(&dns.IPv6Servers)).m = make(map[string][]*uintptr)
|
(*testlist)(unsafe.Pointer(&dns.IPv6Servers)).m = make(map[string][]*uintptr)
|
||||||
dns.IPv4Servers.Add(map[string][]string{
|
dns.IPv4Servers.Add(&dns.DNSConfig{
|
||||||
|
Servers: map[string][]string{
|
||||||
"dot.360.cn": {
|
"dot.360.cn": {
|
||||||
"101.198.192.33:853",
|
"101.198.192.33:853",
|
||||||
"112.65.69.15:853",
|
"112.65.69.15:853",
|
||||||
@ -28,8 +29,10 @@ func TestRequest(t *testing.T) {
|
|||||||
"123.125.81.6:853",
|
"123.125.81.6:853",
|
||||||
"140.207.198.6:853",
|
"140.207.198.6:853",
|
||||||
},
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
dns.IPv6Servers.Add(map[string][]string{
|
dns.IPv6Servers.Add(&dns.DNSConfig{
|
||||||
|
Servers: map[string][]string{
|
||||||
"dot.360.cn": {
|
"dot.360.cn": {
|
||||||
"101.198.192.33:853",
|
"101.198.192.33:853",
|
||||||
"112.65.69.15:853",
|
"112.65.69.15:853",
|
||||||
@ -38,6 +41,7 @@ func TestRequest(t *testing.T) {
|
|||||||
"123.125.81.6:853",
|
"123.125.81.6:853",
|
||||||
"140.207.198.6:853",
|
"140.207.198.6:853",
|
||||||
},
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
r := gorequest(`{"code":0,"headers":{"authorization":"Token ","host":"api.mangacopy.com","source":"copyApp","webp":"1","region":"1","version":"2.1.7","platform":"3","user-agent":"COPY/2.1.7"},"method":"GET","url":"https://api.mangacopy.com/api/v3/h5/homeIndex?platform\u003d3"}`)
|
r := gorequest(`{"code":0,"headers":{"authorization":"Token ","host":"api.mangacopy.com","source":"copyApp","webp":"1","region":"1","version":"2.1.7","platform":"3","user-agent":"COPY/2.1.7"},"method":"GET","url":"https://api.mangacopy.com/api/v3/h5/homeIndex?platform\u003d3"}`)
|
||||||
t.Log(r)
|
t.Log(r)
|
||||||
|
4
main.go
4
main.go
@ -24,10 +24,10 @@ func add_dns(para *C.char, is_ipv6 C.int) *C.char {
|
|||||||
if !ip.IsIPv6Available.Get() {
|
if !ip.IsIPv6Available.Get() {
|
||||||
return C.CString("cannot use ipv6")
|
return C.CString("cannot use ipv6")
|
||||||
}
|
}
|
||||||
dns.IPv6Servers.Add(m)
|
dns.IPv6Servers.Add(&dns.DNSConfig{Servers: m})
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
dns.IPv4Servers.Add(m)
|
dns.IPv4Servers.Add(&dns.DNSConfig{Servers: m})
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user