mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-04 04:37:36 +03:00
implement version-dependent parsing of the Public Header
This commit is contained in:
parent
1a8a012019
commit
dd0daaaf1e
17 changed files with 311 additions and 124 deletions
|
@ -40,7 +40,7 @@ var _ = Describe("QUIC Proxy", func() {
|
|||
|
||||
Context("Proxy setup and teardown", func() {
|
||||
It("sets up the UDPProxy", func() {
|
||||
proxy, err := NewQuicProxy("localhost:0", Opts{RemoteAddr: serverAddr})
|
||||
proxy, err := NewQuicProxy("localhost:0", protocol.VersionWhatever, Opts{RemoteAddr: serverAddr})
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(proxy.clientDict).To(HaveLen(0))
|
||||
|
||||
|
@ -53,7 +53,7 @@ var _ = Describe("QUIC Proxy", func() {
|
|||
})
|
||||
|
||||
It("stops the UDPProxy", func() {
|
||||
proxy, err := NewQuicProxy("localhost:0", Opts{RemoteAddr: serverAddr})
|
||||
proxy, err := NewQuicProxy("localhost:0", protocol.VersionWhatever, Opts{RemoteAddr: serverAddr})
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
port := proxy.LocalPort()
|
||||
err = proxy.Close()
|
||||
|
@ -71,7 +71,7 @@ var _ = Describe("QUIC Proxy", func() {
|
|||
})
|
||||
|
||||
It("has the correct LocalAddr and LocalPort", func() {
|
||||
proxy, err := NewQuicProxy("localhost:0", Opts{RemoteAddr: serverAddr})
|
||||
proxy, err := NewQuicProxy("localhost:0", protocol.VersionWhatever, Opts{RemoteAddr: serverAddr})
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
||||
Expect(proxy.LocalAddr().String()).To(Equal("127.0.0.1:" + strconv.Itoa(proxy.LocalPort())))
|
||||
|
@ -92,7 +92,7 @@ var _ = Describe("QUIC Proxy", func() {
|
|||
|
||||
startProxy := func(opts Opts) {
|
||||
var err error
|
||||
proxy, err = NewQuicProxy("localhost:0", opts)
|
||||
proxy, err = NewQuicProxy("localhost:0", protocol.VersionWhatever, opts)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
clientConn, err = net.DialUDP("udp", nil, proxy.LocalAddr().(*net.UDPAddr))
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue