Skip to content

runtime: run periodic ipv4 stuns for public ip#234

Open
npry wants to merge 1 commit into
mainfrom
npry/runtime.stun
Open

runtime: run periodic ipv4 stuns for public ip#234
npry wants to merge 1 commit into
mainfrom
npry/runtime.stun

Conversation

@npry

@npry npry commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

stacked on #214

Provide an actor that runs periodic stuns to a derp server to get our public ipv4 and publishes the response on the message bus.

Nothing currently consumes the messages, but this is needed for future commits re: direct connections. In the future the internals may change slightly to reuse the single UDP endpoint socket rather than using a dedicated stun socket, but this should be fine for now.

@dylan-tailscale dylan-tailscale left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, just one TODO to implement (correct me if I misunderstood the intent)

Comment thread ts_runtime/src/stunner.rs
type Args = Env;

async fn on_start(env: Self::Args, slf: ActorRef<Self>) -> Result<Self, Self::Error> {
let stun = ts_netcheck::StunProber::try_new().await.unwrap(); // TODO

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the "TODO" mean to "replace the unwrap() with an error convert/return"?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, whoops

Base automatically changed from npry/netmon to main June 13, 2026 10:30
@npry npry force-pushed the npry/runtime.stun branch from 89bdd53 to 21a75d7 Compare June 13, 2026 10:34
Nothing currently consumes the messages, but this is needed for future
commits re: direct connections. In the future the internals may change
slightly to reuse the single UDP endpoint socket, but this should work
for now.

Signed-off-by: Nathan Perry <nathan@tailscale.com>
Change-Id: Idc9dadd16a203188ab4138944fb8a6b56a6a6964
@npry npry force-pushed the npry/runtime.stun branch from 21a75d7 to a8b8a82 Compare June 15, 2026 07:30
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

Successfully merging this pull request may close these issues.

2 participants