Skip to content

Commit

Permalink
Merge branch 'master' of github.com:v2fly/v2ray-core into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
JimmyHuang454 committed May 6, 2024
2 parents 91c2d87 + 1c103e6 commit 76051df
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 55 deletions.
2 changes: 1 addition & 1 deletion common/crypto/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func (r *AuthenticationReader) readInternal(soft bool, mb *buf.MultiBuffer) erro
return errSoft
}

if size <= buf.Size {
if effectiveSize <= buf.Size {
b, err := r.readBuffer(effectiveSize, int32(padding))
if err != nil {
return err
Expand Down
1 change: 1 addition & 0 deletions common/protocol/http/headers.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func RemoveHopByHopHeaders(header http.Header) {
header.Del("Trailers")
header.Del("Transfer-Encoding")
header.Del("Upgrade")
header.Del("Keep-Alive")

connections := header.Get("Connection")
header.Del("Connection")
Expand Down
2 changes: 1 addition & 1 deletion core.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
)

var (
version = "5.15.1"
version = "5.16.1"
build = "Custom"
codename = "V2Fly, a community-driven edition of V2Ray."
intro = "A unified platform for anti-censorship."
Expand Down
36 changes: 18 additions & 18 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,48 +10,48 @@ require (
github.com/apernet/quic-go v0.42.1-0.20240323215309-32a339817822
github.com/go-chi/chi/v5 v5.0.12
github.com/go-chi/render v1.0.3
github.com/go-playground/validator/v10 v10.19.0
github.com/go-playground/validator/v10 v10.20.0
github.com/golang/mock v1.6.0
github.com/golang/protobuf v1.5.4
github.com/google/go-cmp v0.6.0
github.com/google/gopacket v1.1.19
github.com/gorilla/websocket v1.5.1
github.com/jhump/protoreflect v1.15.6
github.com/jhump/protoreflect v1.16.0
github.com/lunixbochs/struc v0.0.0-20200707160740-784aaebc1d40
github.com/miekg/dns v1.1.58
github.com/miekg/dns v1.1.59
github.com/mustafaturan/bus v1.0.2
github.com/pelletier/go-toml v1.9.5
github.com/pion/transport/v2 v2.2.4
github.com/pion/transport/v2 v2.2.5
github.com/pires/go-proxyproto v0.7.0
github.com/quic-go/quic-go v0.41.0
github.com/refraction-networking/utls v1.6.3
github.com/quic-go/quic-go v0.43.0
github.com/refraction-networking/utls v1.6.5
github.com/seiflotfy/cuckoofilter v0.0.0-20220411075957-e3b120b3f5fb
github.com/stretchr/testify v1.8.4
github.com/stretchr/testify v1.9.0
github.com/v2fly/BrowserBridge v0.0.0-20210430233438-0570fc1d7d08
github.com/v2fly/VSign v0.0.0-20201108000810-e2adc24bf848
github.com/v2fly/ss-bloomring v0.0.0-20210312155135-28617310f63e
github.com/vincent-petithory/dataurl v1.0.0
github.com/xiaokangwang/VLite v0.0.0-20220418190619-cff95160a432
go.starlark.net v0.0.0-20230612165344-9532f5667272
go4.org/netipx v0.0.0-20230303233057-f1b76eb4bb35
golang.org/x/crypto v0.21.0
golang.org/x/net v0.22.0
golang.org/x/sync v0.6.0
golang.org/x/sys v0.18.0
google.golang.org/grpc v1.62.1
google.golang.org/protobuf v1.33.0
golang.org/x/crypto v0.22.0
golang.org/x/net v0.24.0
golang.org/x/sync v0.7.0
golang.org/x/sys v0.19.0
google.golang.org/grpc v1.63.2
google.golang.org/protobuf v1.34.0
gopkg.in/yaml.v3 v3.0.1
gvisor.dev/gvisor v0.0.0-20231020174304-b8a429915ff1
h12.io/socks v1.0.3
lukechampine.com/blake3 v1.2.1
lukechampine.com/blake3 v1.3.0
)

require (
github.com/aead/cmac v0.0.0-20160719120800-7af84192f0b1 // indirect
github.com/ajg/form v1.5.1 // indirect
github.com/andybalholm/brotli v1.0.6 // indirect
github.com/boljen/go-bitmap v0.0.0-20151001105940-23cd2fb0ce7d // indirect
github.com/bufbuild/protocompile v0.8.0 // indirect
github.com/bufbuild/protocompile v0.10.0 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgryski/go-metro v0.0.0-20211217172704-adc40b04c140 // indirect
Expand All @@ -77,15 +77,15 @@ require (
github.com/quic-go/qpack v0.4.0 // indirect
github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3 // indirect
github.com/secure-io/siv-go v0.0.0-20180922214919-5ff40651e2c4 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/xtaci/smux v1.5.24 // indirect
go.uber.org/mock v0.4.0 // indirect
golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81 // indirect
golang.org/x/exp v0.0.0-20230725093048-515e97ebf090 // indirect
golang.org/x/mod v0.16.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.19.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect
)

replace github.com/lunixbochs/struc v0.0.0-20200707160740-784aaebc1d40 => github.com/xiaokangwang/struc v0.0.0-20231031203518-0e381172f248
Expand Down
70 changes: 36 additions & 34 deletions go.sum

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions proxy/shadowsocks2022/method_aes128gcm.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ func (a AES128GCMMethod) GetUDPClientProcessor(ipsk [][]byte, psk []byte, deriva
}
return aead
}
if len(ipsk) == 0 {
return NewAESUDPClientPacketProcessor(reqSeparateHeaderCipher, respSeparateHeaderCipher, getPacketAEAD, nil), nil
}
eihGenerator := newAESEIHGeneratorContainer(len(ipsk), psk, ipsk)
getEIH := func(mask []byte) ExtensibleIdentityHeaders {
eih, err := eihGenerator.GenerateEIHUDP(derivation, a, mask)
Expand Down
3 changes: 3 additions & 0 deletions proxy/shadowsocks2022/method_aes256gcm.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ func (a AES256GCMMethod) GetUDPClientProcessor(ipsk [][]byte, psk []byte, deriva
}
return aead
}
if len(ipsk) == 0 {
return NewAESUDPClientPacketProcessor(reqSeparateHeaderCipher, respSeparateHeaderCipher, getPacketAEAD, nil), nil
}
eihGenerator := newAESEIHGeneratorContainer(len(ipsk), psk, ipsk)
getEIH := func(mask []byte) ExtensibleIdentityHeaders {
eih, err := eihGenerator.GenerateEIHUDP(derivation, a, mask)
Expand Down
10 changes: 9 additions & 1 deletion transport/internet/request/roundtripper/httprt/httprt.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"io"
gonet "net"
"net/http"
"time"

"github.com/v2fly/v2ray-core/v5/transport/internet/transportcommon"

Expand Down Expand Up @@ -119,7 +120,14 @@ func (h *httpTripperServer) Start() error {
}
h.listener = listener
go func() {
err := http.Serve(listener, h)
httpServer := http.Server{
ReadHeaderTimeout: 15 * time.Second,
ReadTimeout: 15 * time.Second,
WriteTimeout: 10 * time.Second,
IdleTimeout: 30 * time.Second,
}
httpServer.Handler = h
err := httpServer.Serve(h.listener)
if err != nil {
newError("unable to serve listener for http tripper server").Base(err).WriteToLog()
}
Expand Down

0 comments on commit 76051df

Please sign in to comment.