zizifn / edgetunnel

Running V2ray inside edge/serverless runtime
GNU General Public License v2.0
7.11k stars 24.87k forks source link

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

Open fwqaaq opened 7 months ago

fwqaaq commented 7 months ago

https://github.com/zizifn/edgetunnel/blob/4221293b0abd63cc139adb24f0e707548e488dfb/src/worker-vless.js#L540-L548

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

zizifn commented 7 months ago

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

fwqaaq commented 7 months ago

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 commented 7 months ago

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 commented 6 months ago

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.