hertz-contrib / http3

Apache License 2.0
10 stars 8 forks source link

pls update this, it can work with go 1.22 but example is not working #9

Open kolinfluence opened 7 months ago

kolinfluence commented 7 months ago

change lucas clement to quic-go repo naming

go build mainq.go 
mainq.go:29:2: no required module provides package github.com/hertz-contrib/http3/network/quic-go; to add it:
    go get github.com/hertz-contrib/http3/network/quic-go
mainq.go:30:2: no required module provides package github.com/hertz-contrib/http3/network/quic-go/testdata; to add it:
    go get github.com/hertz-contrib/http3/network/quic-go/testdata
mainq.go:31:2: no required module provides package github.com/hertz-contrib/http3/server/quic-go; to add it:
    go get github.com/hertz-contrib/http3/server/quic-go
mainq.go:32:2: no required module provides package github.com/hertz-contrib/http3/server/quic-go/factory; to add it:
    go get github.com/hertz-contrib/http3/server/quic-go/factory
(base) root@ubuntu:/usr/local/src/http2/examples/h2# go mod tidy
go: finding module for package github.com/hertz-contrib/http3/server/quic-go/factory
go: finding module for package github.com/hertz-contrib/http3/network/quic-go/testdata
go: finding module for package github.com/hertz-contrib/http3/network/quic-go
go: finding module for package github.com/hertz-contrib/http3/server/quic-go
go: downloading github.com/hertz-contrib/http3/network/quic-go v0.1.0
go: downloading github.com/hertz-contrib/http3/server/quic-go v0.1.0
go: downloading github.com/hertz-contrib/http3 v0.0.0-20231114072224-d8cbb42efc04
go: found github.com/hertz-contrib/http3/network/quic-go in github.com/hertz-contrib/http3/network/quic-go v0.1.0
go: found github.com/hertz-contrib/http3/network/quic-go/testdata in github.com/hertz-contrib/http3/network/quic-go v0.1.0
go: found github.com/hertz-contrib/http3/server/quic-go in github.com/hertz-contrib/http3/server/quic-go v0.1.0
go: found github.com/hertz-contrib/http3/server/quic-go/factory in github.com/hertz-contrib/http3/server/quic-go v0.1.0
go: downloading google.golang.org/protobuf v1.28.0
go: downloading github.com/lucas-clemente/quic-go v0.31.0
go: downloading github.com/onsi/ginkgo/v2 v2.2.0
go: downloading github.com/onsi/gomega v1.20.1
go: downloading github.com/google/go-cmp v0.5.8
go: downloading github.com/golang/mock v1.6.0
go: downloading github.com/marten-seemann/qpack v0.3.0
go: downloading golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e
go: downloading golang.org/x/crypto v0.0.0-20210921155107-089bfa567519
go: downloading github.com/marten-seemann/qtls-go1-18 v0.1.3
go: downloading github.com/marten-seemann/qtls-go1-19 v0.1.1
go: downloading golang.org/x/tools v0.1.12
go: downloading github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0
go: downloading github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38
go: downloading golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4
(base) root@ubuntu:/usr/local/src/http2/examples/h2# go build mainq.go 
# github.com/lucas-clemente/quic-go/internal/qtls
/root/go/pkg/mod/github.com/lucas-clemente/quic-go@v0.31.0/internal/qtls/go120.go:5:13: cannot use "The version of quic-go you're using can't be built on Go 1.20 yet. For more details, please see https://github.com/lucas-clemente/quic-go/wiki/quic-go-and-Go-versions." (untyped string constant "The version of quic-go you're using can't be built on Go 1.20 yet. F...) as int value in variable declaration
kolinfluence commented 7 months ago

updated the quic-go to latest manually but got this:

go build main.go 
# github.com/hertz-contrib/http3/network/quic-go
vendor/github.com/hertz-contrib/http3/network/quic-go/connection.go:79:9: cannot use &conn{…} (value of type *conn) as network.StreamConn value in return statement: *conn does not implement network.StreamConn (wrong type for method HandshakeComplete)
        have HandshakeComplete() <-chan struct{}
        want HandshakeComplete() context.Context
vendor/github.com/hertz-contrib/http3/network/quic-go/transport.go:99:13: cannot use quic.ListenAddrEarly(addr, baseConf, quicConf) (value of type *"github.com/quic-go/quic-go".EarlyListener) as "github.com/quic-go/quic-go".EarlyListener value in assignment
vendor/github.com/hertz-contrib/http3/network/quic-go/transport.go:101:13: cannot use quic.ListenEarly(conn, baseConf, quicConf) (value of type *"github.com/quic-go/quic-go".EarlyListener) as "github.com/quic-go/quic-go".EarlyListener value in assignment
vendor/github.com/hertz-contrib/http3/network/quic-go/transport.go:106:15: cannot use ln (variable of type "github.com/quic-go/quic-go".EarlyListener) as io.Closer value in assignment: "github.com/quic-go/quic-go".EarlyListener does not implement io.Closer (method Close has pointer receiver)
li-jin-gou commented 6 months ago

Hello,Can you submit a PR? @kolinfluence

jkskj commented 3 months ago

In quic-go,Connection.HandshakeComplete returns a channels instead of a context.Context after v0.34.0.

    // HandshakeComplete blocks until the handshake completes (or fails).
    // For the client, data sent before completion of the handshake is encrypted with 0-RTT keys.
    // For the server, data sent before completion of the handshake is encrypted with 1-RTT keys,
    // however the client's identity is only verified once the handshake completes.
    HandshakeComplete() <-chan struct{}

But in hertz/pkg/network,it need HandshakeComplete to return context.Context.

         // HandshakeComplete blocks until the handshake completes (or fails).
    HandshakeComplete() context.Context

maybe need to submit a PR to hertz.