Skip to content

Commit

Permalink
Merge pull request #983 from honwen/master
Browse files Browse the repository at this point in the history
bump deps; bump sdk to 1.21
  • Loading branch information
ginuerzh committed Jun 13, 2024
2 parents 77262f2 + 17685b4 commit 44aac5a
Show file tree
Hide file tree
Showing 12 changed files with 104 additions and 159 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- run: git fetch --force --tags
- uses: actions/setup-go@v3
with:
go-version: '1.19'
go-version: '1.21.7'
cache: true
# More assembly might be required: Docker logins, GPG, etc. It all depends
# on your needs.
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=$BUILDPLATFORM golang:1.20-alpine as builder
FROM --platform=$BUILDPLATFORM golang:1.21-alpine as builder

# Convert TARGETPLATFORM to GOARCH format
# https://github.com/tonistiigi/xx
Expand All @@ -13,6 +13,7 @@ ADD . /src
WORKDIR /src

ENV GO111MODULE=on
ENV CGO_ENABLED=0

RUN cd cmd/gost && go env && go build -v

Expand Down
46 changes: 22 additions & 24 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,63 +1,61 @@
module github.com/ginuerzh/gost

go 1.20
go 1.21

replace github.com/templexxx/cpu v0.0.7 => github.com/templexxx/cpu v0.0.10-0.20211111114238-98168dcec14a

require (
git.torproject.org/pluggable-transports/goptlib.git v1.2.0
git.torproject.org/pluggable-transports/goptlib.git v1.3.0
github.com/LiamHaworth/go-tproxy v0.0.0-20190726054950-ef7efd7f24ed
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2
github.com/go-gost/gosocks4 v0.0.1
github.com/go-gost/gosocks5 v0.3.0
github.com/go-gost/relay v0.1.1-0.20211123134818-8ef7fd81ffd7
github.com/go-gost/tls-dissector v0.0.2-0.20220408131628-aac992c27451
github.com/go-log/log v0.2.0
github.com/gobwas/glob v0.2.3
github.com/gorilla/websocket v1.4.2
github.com/klauspost/compress v1.13.6
github.com/gorilla/websocket v1.5.1
github.com/klauspost/compress v1.17.6
github.com/miekg/dns v1.1.58
github.com/quic-go/quic-go v0.41.0
github.com/mdlayher/vsock v1.2.1
github.com/miekg/dns v1.1.47
github.com/quic-go/quic-go v0.32.0
github.com/ryanuber/go-glob v1.0.0
github.com/shadowsocks/go-shadowsocks2 v0.1.5
github.com/shadowsocks/shadowsocks-go v0.0.0-20200409064450-3e585ff90601
github.com/songgao/water v0.0.0-20200317203138-2b4b6d7c09d8
github.com/xtaci/kcp-go/v5 v5.6.1
github.com/xtaci/smux v1.5.16
github.com/xtaci/kcp-go/v5 v5.6.7
github.com/xtaci/smux v1.5.24
github.com/xtaci/tcpraw v1.2.25
gitlab.com/yawning/obfs4.git v0.0.0-20220204003609-77af0cba934d
golang.org/x/crypto v0.17.0
golang.org/x/net v0.10.0
golang.org/x/crypto v0.18.0
golang.org/x/net v0.20.0
)

require (
filippo.io/edwards25519 v1.0.0-rc.1.0.20210721174708-390f27c3be20 // indirect
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da // indirect
github.com/coreos/go-iptables v0.6.0 // indirect
github.com/dchest/siphash v1.2.2 // indirect
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/google/gopacket v1.1.19 // indirect
github.com/google/pprof v0.0.0-20230131232505-5a9e8f65f08f // indirect
github.com/klauspost/cpuid/v2 v2.0.9 // indirect
github.com/klauspost/reedsolomon v1.9.15 // indirect
github.com/klauspost/cpuid/v2 v2.2.6 // indirect
github.com/klauspost/reedsolomon v1.12.0 // indirect
github.com/onsi/ginkgo/v2 v2.9.5 // indirect
github.com/mdlayher/socket v0.4.1 // indirect
github.com/onsi/ginkgo/v2 v2.8.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/quic-go/qtls-go1-18 v0.2.0 // indirect
github.com/quic-go/qtls-go1-19 v0.2.0 // indirect
github.com/quic-go/qtls-go1-20 v0.1.0 // indirect
github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3 // indirect
github.com/templexxx/cpu v0.0.7 // indirect
github.com/templexxx/xorsimd v0.4.1 // indirect
github.com/templexxx/cpu v0.1.0 // indirect
github.com/templexxx/xorsimd v0.4.2 // indirect
github.com/tjfoc/gmsm v1.4.1 // indirect
github.com/xtaci/lossyconn v0.0.0-20200209145036-adba10fffc37 // indirect
gitlab.com/yawning/edwards25519-extra.git v0.0.0-20211229043746-2f91fcc9fbdb // indirect
go.uber.org/mock v0.3.0 // indirect
golang.org/x/exp v0.0.0-20230203172020-98cc5a0785f9 // indirect
golang.org/x/mod v0.8.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.6.0 // indirect
golang.org/x/tools v0.17.0 // indirect
golang.org/x/sync v0.1.0 // indirect
)
175 changes: 62 additions & 113 deletions go.sum

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions gost.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
)

// Version is the gost version.
const Version = "2.11.5"
const Version = "2.12.0"

// Debug is a flag that enables the debug log.
var Debug bool
Expand Down Expand Up @@ -149,9 +149,7 @@ func (rw *readWriter) Write(p []byte) (n int, err error) {
return rw.w.Write(p)
}

var (
nopClientConn = &nopConn{}
)
var nopClientConn = &nopConn{}

// a nop connection implements net.Conn,
// it does nothing.
Expand Down
8 changes: 4 additions & 4 deletions quic.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ func (tr *quicTransporter) initSession(addr net.Addr, conn net.PacketConn) (*qui
KeepAlivePeriod: config.KeepAlivePeriod,
Versions: []quic.VersionNumber{
quic.Version1,
quic.VersionDraft29,
quic.Version2,
},
}
session, err := quic.DialEarly(conn, addr, addr.String(), tlsConfigQUICALPN(config.TLSConfig), quicConfig)
session, err := quic.DialEarly(context.Background(), conn, addr, tlsConfigQUICALPN(config.TLSConfig), quicConfig)
if err != nil {
log.Logf("quic dial %s: %v", addr, err)
return nil, err
Expand Down Expand Up @@ -157,7 +157,7 @@ func QUICListener(addr string, config *QUICConfig) (Listener, error) {
MaxIdleTimeout: config.IdleTimeout,
Versions: []quic.VersionNumber{
quic.Version1,
quic.VersionDraft29,
quic.Version2,
},
}

Expand Down Expand Up @@ -186,7 +186,7 @@ func QUICListener(addr string, config *QUICConfig) (Listener, error) {
}

l := &quicListener{
ln: ln,
ln: *ln,
connChan: make(chan net.Conn, 1024),
errChan: make(chan error, 1),
}
Expand Down
1 change: 1 addition & 0 deletions redirect.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package gost
Expand Down
4 changes: 2 additions & 2 deletions redirect_other.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !linux
// +build !linux

package gost
Expand Down Expand Up @@ -35,8 +36,7 @@ func (h *tcpRedirectHandler) Handle(c net.Conn) {
c.Close()
}

type udpRedirectHandler struct {
}
type udpRedirectHandler struct{}

// UDPRedirectHandler creates a server Handler for UDP transparent server.
func UDPRedirectHandler(opts ...HandlerOption) Handler {
Expand Down
1 change: 1 addition & 0 deletions signal.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build windows
// +build windows

package gost
Expand Down
2 changes: 1 addition & 1 deletion sockopts_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ func setSocketMark(fd int, value int) (e error) {

func setSocketInterface(fd int, value string) (e error) {
return syscall.SetsockoptString(fd, syscall.SOL_SOCKET, syscall.SO_BINDTODEVICE, value)
}
}
14 changes: 5 additions & 9 deletions ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"encoding/binary"
"errors"
"fmt"
"os"
"net"
"os"
"strconv"
"strings"
"sync"
Expand All @@ -27,9 +27,7 @@ const (
GostSSHTunnelRequest = "gost-tunnel" // extended request type for ssh tunnel
)

var (
errSessionDead = errors.New("session is dead")
)
var errSessionDead = errors.New("session is dead")

// ParseSSHKeyFile parses ssh key file.
func ParseSSHKeyFile(fp string) (ssh.Signer, error) {
Expand Down Expand Up @@ -59,8 +57,7 @@ func ParseSSHAuthorizedKeysFile(fp string) (map[string]bool, error) {
return authorizedKeysMap, nil
}

type sshDirectForwardConnector struct {
}
type sshDirectForwardConnector struct{}

// SSHDirectForwardConnector creates a Connector for SSH TCP direct port forwarding.
func SSHDirectForwardConnector() Connector {
Expand Down Expand Up @@ -103,8 +100,7 @@ func (c *sshDirectForwardConnector) ConnectContext(ctx context.Context, conn net
return conn, nil
}

type sshRemoteForwardConnector struct {
}
type sshRemoteForwardConnector struct{}

// SSHRemoteForwardConnector creates a Connector for SSH TCP remote port forwarding.
func SSHRemoteForwardConnector() Connector {
Expand Down Expand Up @@ -650,7 +646,7 @@ func (h *sshForwardHandler) tcpipForwardRequest(sshConn ssh.Conn, req *ssh.Reque
return
}

ln, err := net.Listen("tcp", addr) //tie to the client connection
ln, err := net.Listen("tcp", addr) // tie to the client connection
if err != nil {
log.Log("[ssh-rtcp]", err)
req.Reply(false, nil)
Expand Down
1 change: 1 addition & 0 deletions tuntap_unix.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !linux && !windows && !darwin
// +build !linux,!windows,!darwin

package gost
Expand Down

0 comments on commit 44aac5a

Please sign in to comment.