Merge pull request #12 from gost-dev/bump-deps

Bump deps and remove deprecated method
This commit is contained in:
ginuerzh
2023-09-18 21:19:20 +08:00
committed by GitHub
13 changed files with 34 additions and 37 deletions

View File

@ -10,7 +10,6 @@ import (
"fmt"
"hash/crc32"
"io"
"io/ioutil"
"net"
"net/http"
"net/http/httputil"
@ -149,7 +148,7 @@ func (h *http2Handler) roundTrip(ctx context.Context, w http.ResponseWriter, req
ProtoMajor: 2,
ProtoMinor: 0,
Header: http.Header{},
Body: ioutil.NopCloser(bytes.NewReader([]byte{})),
Body: io.NopCloser(bytes.NewReader([]byte{})),
}
if !h.authenticate(ctx, w, req, resp, log) {

View File

@ -5,7 +5,6 @@ import (
"errors"
"fmt"
"io"
"io/ioutil"
"net"
"time"
@ -77,7 +76,7 @@ func (h *socks5Handler) handleUDP(ctx context.Context, conn net.Conn, log logger
t := time.Now()
log.Debugf("%s <-> %s", conn.RemoteAddr(), cc.LocalAddr())
io.Copy(ioutil.Discard, conn)
io.Copy(io.Discard, conn)
log.WithFields(map[string]any{"duration": time.Since(t)}).
Debugf("%s >-< %s", conn.RemoteAddr(), cc.LocalAddr())

View File

@ -3,7 +3,6 @@ package ss
import (
"context"
"io"
"io/ioutil"
"net"
"time"
@ -92,7 +91,7 @@ func (h *ssHandler) Handle(ctx context.Context, conn net.Conn, opts ...handler.H
addr := &gosocks5.Addr{}
if _, err := addr.ReadFrom(conn); err != nil {
log.Error(err)
io.Copy(ioutil.Discard, conn)
io.Copy(io.Discard, conn)
return err
}