Skip to content

Commit

Permalink
Update golang toolchain to v1.22
Browse files Browse the repository at this point in the history
  • Loading branch information
mohanson committed Mar 31, 2024
1 parent f016abe commit 9894639
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.21'
go-version: '1.22'
- name: Make
run: ./cmd/develop.sh
- name: Test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.21'
go-version: '1.22'
- name: Make
run: ./cmd/release.sh
- name: Push
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div align="center" style="background-color: #FFFFFF"><img src="./res/daze.png"></div>
# Daze

Daze is a software that helps you pass through firewalls, in other words, a proxy. It uses a simple yet efficient protocol, ensuring that you never get detected or blocked.

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/mohanson/daze

go 1.21
go 1.22
2 changes: 1 addition & 1 deletion lib/lru/lru_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func TestLruSize(t *testing.T) {
if c.List.Size != c.Len() || c.Len() != 4 {
t.FailNow()
}
for i := 0; i < 65536; i++ {
for range 65536 {
rand.Read(b)
c.Set(hex.EncodeToString(b), int(binary.LittleEndian.Uint32(b)))
if c.List.Size != c.Len() || c.Len() != 4 {
Expand Down
4 changes: 2 additions & 2 deletions protocol/ashe/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func (s *Server) Hello(con io.ReadWriteCloser) (io.ReadWriteCloser, error) {
return nil, err
}
// To build a key from pre-shared key. Use xor as our key derivation function.
for i := 0; i < 32; i++ {
for i := range 32 {
buf[i] ^= s.Cipher[i]
}
cli = daze.Gravity(con, buf[:])
Expand Down Expand Up @@ -260,7 +260,7 @@ func (c *Client) Hello(con io.ReadWriteCloser) (io.ReadWriteCloser, error) {
return nil, err
}
// To build a key from pre-shared key. Use xor as our key derivation function.
for i := 0; i < 32; i++ {
for i := range 32 {
buf[i] ^= c.Cipher[i]
}
srv = daze.Gravity(con, buf[:])
Expand Down
2 changes: 1 addition & 1 deletion protocol/baboon/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func (s *Server) Route(r *http.Request) int {
hash.Write(authData[:16])
hash.Write(s.Cipher[:16])
sign := hash.Sum(nil)
for i := 0; i < 16; i++ {
for i := range 16 {
if authData[16+i] != sign[i] {
return 0
}
Expand Down
4 changes: 2 additions & 2 deletions protocol/czar/mux.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ func NewMux(conn net.Conn) *Mux {
// NewMuxServer returns a new MuxServer.
func NewMuxServer(conn net.Conn) *Mux {
mux := NewMux(conn)
for i := 0; i < 256; i++ {
for i := range 256 {
stm := NewStream(uint8(i), mux)
stm.son.Do(func() {})
stm.Close()
Expand All @@ -247,7 +247,7 @@ func NewMuxServer(conn net.Conn) *Mux {
// NewMuxClient returns a new MuxClient.
func NewMuxClient(conn net.Conn) *Mux {
idp := make(chan uint8, 256)
for i := 0; i < 256; i++ {
for i := range 256 {
idp <- uint8(i)
}
mux := NewMux(conn)
Expand Down
Binary file removed res/daze.png
Binary file not shown.
72 changes: 53 additions & 19 deletions res/rule.cidr
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ L 36.37.40.0/21
L 36.37.48.0/20
L 36.40.0.0/13
L 36.48.0.0/15
L 36.50.226.0/23
L 36.50.254.0/23
L 36.51.0.0/16
L 36.56.0.0/13
L 36.96.0.0/11
Expand Down Expand Up @@ -173,6 +175,7 @@ L 39.128.0.0/10
L 40.72.0.0/15
L 40.125.128.0/17
L 40.126.64.0/18
L 40.162.0.0/16
L 42.0.0.0/22
L 42.0.8.0/21
L 42.0.16.0/21
Expand Down Expand Up @@ -2163,7 +2166,6 @@ L 103.27.24.0/22
L 103.27.56.0/22
L 103.27.96.0/22
L 103.27.184.0/22
L 103.27.208.0/22
L 103.27.212.0/22
L 103.27.240.0/22
L 103.28.4.0/22
Expand Down Expand Up @@ -2512,6 +2514,7 @@ L 103.40.44.0/22
L 103.40.88.0/22
L 103.40.100.0/22
L 103.40.158.0/23
L 103.40.174.0/23
L 103.40.192.0/22
L 103.40.212.0/22
L 103.40.220.0/22
Expand Down Expand Up @@ -3036,7 +3039,6 @@ L 103.69.16.0/22
L 103.69.62.0/23
L 103.69.116.0/22
L 103.69.132.0/22
L 103.69.152.0/22
L 103.70.8.0/22
L 103.70.14.0/23
L 103.70.148.0/22
Expand Down Expand Up @@ -3174,7 +3176,6 @@ L 103.79.64.0/22
L 103.79.68.0/22
L 103.79.80.0/22
L 103.79.84.0/22
L 103.79.120.0/22
L 103.79.136.0/22
L 103.79.188.0/22
L 103.79.192.0/22
Expand All @@ -3184,7 +3185,6 @@ L 103.79.204.0/22
L 103.79.208.0/22
L 103.79.212.0/22
L 103.79.228.0/23
L 103.79.240.0/22
L 103.80.28.0/22
L 103.80.44.0/22
L 103.80.72.0/22
Expand Down Expand Up @@ -3271,7 +3271,6 @@ L 103.87.0.0/22
L 103.87.4.0/22
L 103.87.20.0/22
L 103.87.32.0/22
L 103.87.72.0/22
L 103.87.96.0/22
L 103.87.132.0/22
L 103.87.180.0/22
Expand Down Expand Up @@ -3510,7 +3509,6 @@ L 103.100.252.0/22
L 103.101.4.0/22
L 103.101.8.0/22
L 103.101.12.0/22
L 103.101.28.0/22
L 103.101.60.0/22
L 103.101.120.0/22
L 103.101.124.0/22
Expand Down Expand Up @@ -3609,7 +3607,6 @@ L 103.109.48.0/22
L 103.109.88.0/22
L 103.109.106.0/23
L 103.109.248.0/22
L 103.110.80.0/23
L 103.110.92.0/22
L 103.110.116.0/22
L 103.110.132.0/22
Expand All @@ -3626,7 +3623,6 @@ L 103.112.68.0/22
L 103.112.72.0/22
L 103.112.88.0/22
L 103.112.92.0/22
L 103.112.96.0/22
L 103.112.108.0/22
L 103.112.112.0/22
L 103.112.116.0/22
Expand Down Expand Up @@ -3907,7 +3903,6 @@ L 103.145.92.0/23
L 103.145.94.0/23
L 103.145.98.0/23
L 103.145.106.0/23
L 103.145.122.0/23
L 103.145.188.0/23
L 103.145.190.0/23
L 103.146.72.0/23
Expand Down Expand Up @@ -4470,7 +4465,6 @@ L 103.210.188.0/22
L 103.210.216.0/22
L 103.211.44.0/22
L 103.211.96.0/22
L 103.211.100.0/22
L 103.211.156.0/22
L 103.211.164.0/22
L 103.211.194.0/23
Expand Down Expand Up @@ -5068,7 +5062,6 @@ L 103.241.172.0/23
L 103.241.184.0/22
L 103.241.188.0/22
L 103.241.220.0/22
L 103.242.12.0/22
L 103.242.64.0/22
L 103.242.128.0/22
L 103.242.132.0/22
Expand Down Expand Up @@ -5362,6 +5355,8 @@ L 113.130.96.0/20
L 113.130.112.0/21
L 113.132.0.0/14
L 113.136.0.0/13
L 113.192.40.0/23
L 113.192.56.0/23
L 113.194.0.0/15
L 113.197.100.0/22
L 113.200.0.0/15
Expand Down Expand Up @@ -5515,8 +5510,6 @@ L 116.199.0.0/17
L 116.199.128.0/19
L 116.204.0.0/17
L 116.204.132.0/22
L 116.204.216.0/22
L 116.204.232.0/22
L 116.205.0.0/16
L 116.207.0.0/16
L 116.208.0.0/14
Expand Down Expand Up @@ -5925,6 +5918,7 @@ L 123.99.128.0/17
L 123.100.0.0/19
L 123.101.0.0/16
L 123.103.0.0/17
L 123.108.88.0/23
L 123.108.128.0/20
L 123.108.208.0/20
L 123.112.0.0/12
Expand Down Expand Up @@ -6209,8 +6203,27 @@ L 153.101.0.0/16
L 153.118.0.0/15
L 154.8.128.0/17
L 157.0.0.0/16
L 157.10.34.0/23
L 157.10.36.0/23
L 157.10.112.0/23
L 157.10.118.0/23
L 157.10.130.0/23
L 157.10.218.0/23
L 157.10.220.0/23
L 157.10.246.0/23
L 157.15.74.0/23
L 157.15.94.0/23
L 157.15.100.0/23
L 157.15.102.0/23
L 157.15.104.0/23
L 157.15.200.0/23
L 157.18.0.0/16
L 157.20.33.0/24
L 157.20.136.0/23
L 157.20.194.0/23
L 157.20.246.0/23
L 157.61.0.0/16
L 157.66.42.0/23
L 157.119.8.0/22
L 157.119.12.0/22
L 157.119.16.0/22
Expand All @@ -6235,6 +6248,7 @@ L 157.156.0.0/16
L 157.255.0.0/16
L 158.60.0.0/16
L 158.79.0.0/16
L 158.140.252.0/22
L 159.27.0.0/16
L 159.75.0.0/16
L 159.226.0.0/16
Expand All @@ -6257,7 +6271,6 @@ L 160.202.240.0/22
L 160.202.244.0/22
L 160.202.248.0/22
L 160.202.252.0/22
L 160.238.64.0/22
L 161.120.0.0/16
L 161.189.0.0/16
L 161.207.0.0/16
Expand Down Expand Up @@ -6378,7 +6391,6 @@ L 180.148.152.0/21
L 180.148.216.0/21
L 180.148.224.0/19
L 180.149.128.0/19
L 180.149.236.0/22
L 180.150.160.0/19
L 180.152.0.0/13
L 180.160.0.0/12
Expand Down Expand Up @@ -6629,6 +6641,7 @@ L 202.38.135.0/24
L 202.38.136.0/23
L 202.38.140.0/23
L 202.38.142.0/23
L 202.38.146.0/23
L 202.38.149.0/24
L 202.38.150.0/23
L 202.38.152.0/23
Expand Down Expand Up @@ -6818,7 +6831,6 @@ L 202.90.205.0/24
L 202.90.224.0/21
L 202.90.232.0/21
L 202.91.0.0/22
L 202.91.36.0/22
L 202.91.96.0/20
L 202.91.176.0/20
L 202.91.224.0/19
Expand Down Expand Up @@ -8268,6 +8280,8 @@ L 210.78.192.0/18
L 210.79.64.0/18
L 210.79.224.0/19
L 210.82.0.0/15
L 210.87.72.0/23
L 210.87.114.0/23
L 210.87.128.0/20
L 210.87.144.0/20
L 210.87.160.0/19
Expand Down Expand Up @@ -8712,6 +8726,9 @@ L 2001:df3:1480::/48
L 2001:df3:15c0::/48
L 2001:df3:2a80::/48
L 2001:df3:3a80::/48
L 2001:df3:7440::/48
L 2001:df3:77c0::/48
L 2001:df3:9a40::/48
L 2001:df3:a680::/48
L 2001:df3:b380::/48
L 2001:df3:c380::/48
Expand Down Expand Up @@ -8806,7 +8823,6 @@ L 2400:39c0::/32
L 2400:3a00::/32
L 2400:3a40::/32
L 2400:3b40::/32
L 2400:3bc0::/32
L 2400:3c40::/32
L 2400:3cc0::/32
L 2400:3e00::/32
Expand Down Expand Up @@ -9080,7 +9096,6 @@ L 2401:11c0::/32
L 2401:1200::/32
L 2401:12c0::/32
L 2401:1320::/32
L 2401:13a0::/32
L 2401:15c0::/32
L 2401:18c0::/32
L 2401:18e0::/28
Expand Down Expand Up @@ -9142,25 +9157,39 @@ L 2401:4b00::/32
L 2401:4f80::/32
L 2401:5180::/32
L 2401:5680::/32
L 2401:58a0::/32
L 2401:5960::/32
L 2401:59c0::/32
L 2401:5b40::/32
L 2401:5c20::/32
L 2401:5c60::/32
L 2401:5c80::/32
L 2401:5fa0::/32
L 2401:70e0::/32
L 2401:7180::/32
L 2401:71c0::/32
L 2401:7240::/32
L 2401:7320::/32
L 2401:7340::/32
L 2401:7360::/32
L 2401:73a0::/32
L 2401:7580::/32
L 2401:7660::/32
L 2401:7680::/32
L 2401:7700::/32
L 2401:7780::/32
L 2401:77e0::/32
L 2401:7820::/32
L 2401:7880::/32
L 2401:78e0::/32
L 2401:7980::/32
L 2401:7a00::/32
L 2401:7a80::/32
L 2401:7b80::/32
L 2401:7bc0::/32
L 2401:7c80::/32
L 2401:7cc0::/32
L 2401:7ce0::/32
L 2401:7d40::/32
L 2401:7d80::/32
L 2401:7e00::/32
Expand All @@ -9171,8 +9200,13 @@ L 2401:8380::/32
L 2401:8540::/32
L 2401:8600::/32
L 2401:8680::/32
L 2401:8720::/32
L 2401:87e0::/32
L 2401:8820::/31
L 2401:8840::/32
L 2401:8be0::/32
L 2401:8d00::/32
L 2401:8da0::/32
L 2401:8f40::/32
L 2401:8fc0::/32
L 2401:9340::/32
Expand Down Expand Up @@ -9404,7 +9438,6 @@ L 2402:a680::/32
L 2402:a6c0::/32
L 2402:a840::/32
L 2402:a880::/32
L 2402:a9c0::/32
L 2402:aa80::/32
L 2402:ab80::/32
L 2402:ae00::/32
Expand Down Expand Up @@ -9794,6 +9827,7 @@ L 2403:fe80::/32
L 2403:fec0::/32
L 2403:ff80::/32
L 2403:ffc0::/32
L 2403:ffc1::/32
L 2404:100::/32
L 2404:158::/32
L 2404:240::/32
Expand Down

0 comments on commit 9894639

Please sign in to comment.