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

Why don't handle source port and destination port? #284

Open
fwqaaq opened this issue Apr 17, 2024 · 4 comments
Open

Why don't handle source port and destination port? #284

fwqaaq opened this issue Apr 17, 2024 · 4 comments

Comments

@fwqaaq
Copy link

fwqaaq commented Apr 17, 2024

for (let index = 0; index < chunk.byteLength;) {
const lengthBuffer = chunk.slice(index, index + 2);
const udpPakcetLength = new DataView(lengthBuffer).getUint16(0);
const udpData = new Uint8Array(
chunk.slice(index + 2, index + 2 + udpPakcetLength)
);
index = index + 2 + udpPakcetLength;
controller.enqueue(udpData);
}

Complete UDP messge also includes source port and destination port(total 8 bytes), but it seems they are being ignored in here.

@zizifn
Copy link
Owner

zizifn commented Apr 17, 2024

Port and destination is in vless header. And worker runtime not support udp yet.

@fwqaaq
Copy link
Author

fwqaaq commented Apr 17, 2024

Port and destination is in vless header. And worker runtime not support udp yet.

So vless sends UDP datas after processing, thus it also lacks a checksum?

@xqdoo00o
Copy link

xqdoo00o commented Apr 17, 2024

and no need to use DOH, because some public dns like google 8.8.8.8 open a tcp port 53 to handle dns request, so handleTCPOutBound could handle dns.

@zizifn
Copy link
Owner

zizifn commented Apr 21, 2024

I think in vless format, every udp chunk has a vless header, like tcp chunk. source code. so maybe it's not necessory to set udpStreamWrite. and no need to use DOH, because some public dns like google 8.8.8.8 open a tcp port 53 to handle dns request, so handleTCPOutBound could handle dns.

You are right. In the init implementation, I used 8.8.8.8 for dns, but change to cf doh for speed.

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

3 participants