Skip to content

Add funnel functionality to C library - #28

Open
mastermakrela wants to merge 2 commits into
tailscale:mainfrom
mastermakrela:add-funnel
Open

Add funnel functionality to C library#28
mastermakrela wants to merge 2 commits into
tailscale:mainfrom
mastermakrela:add-funnel

Conversation

@mastermakrela

@mastermakrela mastermakrela commented Jan 19, 2025

Copy link
Copy Markdown
Contributor

While working on Tailscale in js1 I've noticed that while tailscale server equivalent was present, tailscale funnel was missing, although it's available in the underlying tsnet library.

This PR exposes it to be usable from C.

Contributions:

  1. tailscale_listen_funnel — starts a funnel instead of tailnet only listener, otherwise equivalent to tailscale_listen

  2. tailscale_cert_domains — retrieves the domain name under which the funnel is accessible. nice to have for better terminal message

  3. tailscale_accept_nonblocking — not directly connected to the funnel, but helpful for not blocking the js event loop with tailscale_accept

Also, as I was editing it anyway, I've also fixed some typos in tailscale.h.


I see there is a failing check, but I can't see the whole message. Please let me know what I have to correct and I'll gladly do it. :)


Footnotes

  1. PR is a possible future work, but currently FFI in JS is not really standardized. So I've made a separate repo for now.

skialpine added a commit to skialpine/libtailscale that referenced this pull request Jul 12, 2026
…tputs

Informed by tailscale#28 (mastermakrela/add-funnel):
- Guard the empty-CertDomains case in the Funnel entrypoint so enabling Funnel
  before the node has a cert (not logged in / Funnel not approved) returns an
  error instead of panicking and taking down the Go runtime + host app.
- tailscale_get_cert_domain now uses the direct tsnet.Server.CertDomains()
  accessor (confirmed present in tailscale v1.94.1) instead of a LocalClient
  status round-trip.
- .gitignore the mac/ios/android build outputs (.dylib, xcframework, android/,
  include/, out/).
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.

1 participant