Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use with QUIC without running into DATAGRAM frame too large error #81

Open
LeonardWalter opened this issue Dec 5, 2024 · 0 comments

Comments

@LeonardWalter
Copy link

Hi,
I am trying to build a DoQ client combined with a masque proxy.
Currently I am using this code to connect to my DoQ server at myurl:8853:

	template := uritemplate.MustNew("https://myurl.org:9443/masque?h={target_host}&p={target_port}")
	target := "myurl.org:8853"

	raddr, err := net.ResolveUDPAddr("udp", target)
	if err != nil {
		log.Fatalf("failed to resolve udp addr: %v", err)
		return
	}

	cl := masque.Client{
		QUICConfig: &quic.Config{
			EnableDatagrams:   true,
			InitialPacketSize: 1350,
		},
	}

	pconn, _, err := cl.Dial(context.Background(), template, raddr)
	if err != nil {
		log.Fatalf("failed to dial masque proxy: %v", err)
		return
	}

	qc := new(quic.Config)
	qc.DisablePathMTUDiscovery = true
	tc := new(tls.Config)
	tc.ServerName = "myurl.org"
	tc.NextProtos = []string{"doq"}

	earlyConn, err := quic.DialEarly(context.Background(), pconn, raddr, tc, qc)
	if err != nil {
		log.Fatalf("failed to dial target via masque proxy: %v", err)
		return
	}

Everything seems to work fine with the client, but on the proxy I always receive following error, which causes the quic.DialEarly to fail.
2024/12/05 13:57:38 proxying receive side to [2a02:****:5d33]:8853 failed: DATAGRAM frame too large

I already tried different quic.Config InitialPacketSize values for both inner quic and outer masque stream but I cant get it to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant