Skip to content

Commit b9e61dc

Browse files
committed
go1.19
1 parent 3322613 commit b9e61dc

File tree

9 files changed

+146
-176
lines changed

9 files changed

+146
-176
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM --platform=$BUILDPLATFORM golang:1.18-alpine as builder
1+
FROM --platform=$BUILDPLATFORM golang:1.19-alpine as builder
22

33
# Convert TARGETPLATFORM to GOARCH format
44
# https://github.com/tonistiigi/xx

Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@ PLATFORM_LIST = \
2020
linux-mips64 \
2121
linux-mips64le \
2222
linux-s390x \
23+
linux-riscv64 \
2324
freebsd-386 \
2425
freebsd-amd64
2526

2627
WINDOWS_ARCH_LIST = \
2728
windows-386 \
28-
windows-amd64
29+
windows-amd64 \
30+
windows-arm64
2931

3032
all: linux-amd64 darwin-amd64 windows-amd64 # Most used
3133

@@ -74,6 +76,9 @@ linux-mips64le:
7476
linux-s390x:
7577
GOARCH=s390x GOOS=linux $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ $(GOFILES)
7678

79+
linux-riscv64:
80+
GOARCH=riscv64 GOOS=linux $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ $(GOFILES)
81+
7782
freebsd-386:
7883
GOARCH=386 GOOS=freebsd $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ $(GOFILES)
7984

@@ -86,6 +91,9 @@ windows-386:
8691
windows-amd64:
8792
GOARCH=amd64 GOOS=windows $(GOBUILD) -o $(BINDIR)/$(NAME)-$@.exe $(GOFILES)
8893

94+
windows-arm64:
95+
GOARCH=arm64 GOOS=windows $(GOBUILD) -o $(BINDIR)/$(NAME)-$@.exe $(GOFILES)
96+
8997
gz_releases=$(addsuffix .gz, $(PLATFORM_LIST))
9098
zip_releases=$(addsuffix .zip, $(WINDOWS_ARCH_LIST))
9199

cmd/gost/route.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,12 @@ func parseChainNode(ns string) (nodes []gost.Node, err error) {
212212
Timeout: timeout,
213213
IdleTimeout: node.GetDuration("idle"),
214214
}
215+
if config.KeepAlive {
216+
config.KeepAlivePeriod = node.GetDuration("ttl")
217+
if config.KeepAlivePeriod == 0 {
218+
config.KeepAlivePeriod = 10 * time.Second
219+
}
220+
}
215221

216222
if cipher := node.Get("cipher"); cipher != "" {
217223
sum := sha256.Sum256([]byte(cipher))
@@ -458,6 +464,12 @@ func (r *route) GenRouters() ([]router, error) {
458464
Timeout: timeout,
459465
IdleTimeout: node.GetDuration("idle"),
460466
}
467+
if config.KeepAlive {
468+
config.KeepAlivePeriod = node.GetDuration("ttl")
469+
if config.KeepAlivePeriod == 0 {
470+
config.KeepAlivePeriod = 10 * time.Second
471+
}
472+
}
461473
if cipher := node.Get("cipher"); cipher != "" {
462474
sum := sha256.Sum256([]byte(cipher))
463475
config.Key = sum[:]

go.mod

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
module github.com/ginuerzh/gost
22

3-
go 1.17
3+
go 1.18
4+
5+
replace github.com/templexxx/cpu v0.0.7 => github.com/templexxx/cpu v0.0.10-0.20211111114238-98168dcec14a
46

57
require (
68
git.torproject.org/pluggable-transports/goptlib.git v1.2.0
79
github.com/LiamHaworth/go-tproxy v0.0.0-20190726054950-ef7efd7f24ed
810
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d
9-
github.com/docker/libcontainer v2.2.1+incompatible
1011
github.com/go-gost/gosocks4 v0.0.1
1112
github.com/go-gost/gosocks5 v0.3.0
1213
github.com/go-gost/relay v0.1.1-0.20211123134818-8ef7fd81ffd7
@@ -15,9 +16,8 @@ require (
1516
github.com/gobwas/glob v0.2.3
1617
github.com/gorilla/websocket v1.4.2
1718
github.com/klauspost/compress v1.13.6
18-
github.com/lucas-clemente/quic-go v0.26.0
19+
github.com/lucas-clemente/quic-go v0.28.1
1920
github.com/miekg/dns v1.1.47
20-
github.com/milosgajdos/tenus v0.0.3
2121
github.com/ryanuber/go-glob v1.0.0
2222
github.com/shadowsocks/go-shadowsocks2 v0.1.5
2323
github.com/shadowsocks/shadowsocks-go v0.0.0-20200409064450-3e585ff90601
@@ -26,23 +26,25 @@ require (
2626
github.com/xtaci/smux v1.5.16
2727
github.com/xtaci/tcpraw v1.2.25
2828
gitlab.com/yawning/obfs4.git v0.0.0-20220204003609-77af0cba934d
29-
golang.org/x/crypto v0.0.0-20220321153916-2c7772ba3064
30-
golang.org/x/net v0.0.0-20220325170049-de3da57026de
29+
golang.org/x/crypto v0.0.0-20220817201139-bc19a97f63c8
30+
golang.org/x/net v0.0.0-20220812174116-3211cb980234
3131
)
3232

3333
require (
34+
filippo.io/edwards25519 v1.0.0-rc.1.0.20210721174708-390f27c3be20 // indirect
3435
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da // indirect
3536
github.com/cheekybits/genny v1.0.0 // indirect
3637
github.com/coreos/go-iptables v0.6.0 // indirect
3738
github.com/dchest/siphash v1.2.2 // indirect
38-
github.com/fsnotify/fsnotify v1.5.1 // indirect
39+
github.com/fsnotify/fsnotify v1.5.4 // indirect
3940
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect
4041
github.com/google/gopacket v1.1.19 // indirect
4142
github.com/klauspost/cpuid/v2 v2.0.9 // indirect
4243
github.com/klauspost/reedsolomon v1.9.15 // indirect
4344
github.com/marten-seemann/qtls-go1-16 v0.1.5 // indirect
44-
github.com/marten-seemann/qtls-go1-17 v0.1.1 // indirect
45-
github.com/marten-seemann/qtls-go1-18 v0.1.1 // indirect
45+
github.com/marten-seemann/qtls-go1-17 v0.1.2 // indirect
46+
github.com/marten-seemann/qtls-go1-18 v0.1.2 // indirect
47+
github.com/marten-seemann/qtls-go1-19 v0.1.0 // indirect
4648
github.com/nxadm/tail v1.4.8 // indirect
4749
github.com/onsi/ginkgo v1.16.5 // indirect
4850
github.com/pkg/errors v0.9.1 // indirect
@@ -51,10 +53,10 @@ require (
5153
github.com/templexxx/xorsimd v0.4.1 // indirect
5254
github.com/tjfoc/gmsm v1.4.1 // indirect
5355
github.com/xtaci/lossyconn v0.0.0-20200209145036-adba10fffc37 // indirect
54-
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect
55-
golang.org/x/sys v0.0.0-20220325203850-36772127a21f // indirect
56+
gitlab.com/yawning/edwards25519-extra.git v0.0.0-20211229043746-2f91fcc9fbdb // indirect
57+
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
58+
golang.org/x/sys v0.0.0-20220817070843-5a390386f1f2 // indirect
5659
golang.org/x/text v0.3.7 // indirect
57-
golang.org/x/tools v0.1.10 // indirect
58-
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
60+
golang.org/x/tools v0.1.12 // indirect
5961
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
6062
)

0 commit comments

Comments
 (0)