-
Notifications
You must be signed in to change notification settings - Fork 2k
tsnet,wgengine/netstack: add ListenPacket #12184
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
Conversation
f72de82
to
da82771
Compare
Okay, I got this working: % /opt/homebrew/opt/curl/bin/curl -i --http3 https://caddytest.tailb575b.ts.net/
HTTP/3 200
date: Tue, 21 May 2024 16:26:26 GMT
content-length: 2
server: Caddy
content-type: text/plain; charset=utf-8
OK I think the issues I had yesterday were more to do with my browser. Once I got a version of curl compiled with QUIC support, this packet listener seems to work as expected. |
a7406a6
to
d8c0547
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this works for both of what you two need, SGTM.
@@ -908,6 +917,34 @@ func (s *Server) Listen(network, addr string) (net.Listener, error) { | |||
return s.listen(network, addr, listenOnTailnet) | |||
} | |||
|
|||
// ListenPacket announces on the Tailscale network. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL that's exactly the wording the net package uses. okay then
This adds a new ListenPacket function on tsnet.Server which acts mostly like `net.ListenPacket`. Unlike `Server.Listen`, this requires listening on a specific IP and does not automatically listen on both V4 and V6 addresses of the Server when the IP is unspecified. To test this, it also adds UDP support to tsdial.Dialer.UserDial and plumbs it through the localapi. Then an associated test to make sure the UDP functionality works from both sides. Updates #12182 Signed-off-by: Maisem Ali <maisem@tailscale.com>
This adds a new ListenPacket function on tsnet.Server
which acts mostly like
net.ListenPacket
.Unlike
Server.Listen
, this requires listening on aspecific IP and does not automatically listen on both
V4 and V6 addresses of the Server when the IP is unspecified.
To test this, it also adds UDP support to tsdial.Dialer.UserDial
and plumbs it through the localapi. Then an associated test
to make sure the UDP functionality works from both sides.
Updates #12182