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

swift: add NWConnection-inspired Swift 6 compatible TailscaleKit.framework #26

Merged
merged 1 commit into from
Jan 2, 2025

Conversation

barnstar
Copy link
Member

@barnstar barnstar commented Oct 28, 2024

updates tailscale/tailscale#13937

Builds a Tailscale.framework which wraps libtailscale.a in an actor, providing IncomingConnection, Listener, and OutgoingConnection types which are more usable in pure async Swift code. The method signatures are intended to be similar in form to NWConnection. An extension to NSURLSessionConfiguration is provided which will give you a config that lets you do URL requests via the loopback proxy to hosts on your tailnet.

Added functionality to get both the local interface IPs as well as the remote IP of incoming connections accepted by a listener.

Fixed a bug in the log writer so we append a newline.

This also updates to the latest go toolchain and tailscale version.

@barnstar barnstar requested review from raggi and agottardo October 28, 2024 14:48
@bradfitz
Copy link
Member

Nice!

File an oss tracking bug for the effort overall? (which can explain the overall goal, links to docs, etc) There will probably be follow-up changes I'd guess.

@barnstar barnstar force-pushed the barnstar/swift-bindings branch from 6d61c38 to 0b70b0b Compare October 28, 2024 15:26
go.mod Outdated Show resolved Hide resolved
swift/README.md Outdated Show resolved Hide resolved
</BuildableProductRunnable>
<EnvironmentVariables>
<EnvironmentVariable
key = "TSNET_FORCE_LOGIN"

Choose a reason for hiding this comment

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

Maybe explain in the docs what this does?

swift/Tailscale/LogSink.swift Outdated Show resolved Hide resolved
@agottardo
Copy link

Looks great! I would rename this to TailscaleKit to avoid confusion with our app.

@barnstar barnstar force-pushed the barnstar/swift-bindings branch 2 times, most recently from d691004 to a5c4c78 Compare November 12, 2024 02:55
@barnstar barnstar force-pushed the barnstar/swift-bindings branch from a5c4c78 to 8ee2eb0 Compare November 19, 2024 16:53
@barnstar barnstar force-pushed the barnstar/swift-bindings branch from 8ee2eb0 to 271283d Compare January 2, 2025 17:38
@barnstar barnstar changed the title swift: add NWConnection-inspired Swift 6 compatible Tailscale.framework swift: add NWConnection-inspired Swift 6 compatible TailscaleKit.framework Jan 2, 2025
@barnstar barnstar force-pushed the barnstar/swift-bindings branch from 271283d to a28e351 Compare January 2, 2025 19:08
updates tailscale/tailscale#13937

Builds a TailscaleKit.framework which wraps libtailscale.a in an actor,
providing IncomingConnection, Listener, and OutgoingConnection
types which are more usable in pure async Swift code.  The
method signatures are intended to be similar in form to NWConnection.

We also provide an extension to URLSession so you can make URL
requests via the user-space proxy.

Adds a static library mirroring much of the test control utilities in go, minus
the dependency on testing, so that we can export the signatures and
link it to tests that cannot run in go.

Added functionality to get both the local interface IPs as well as
the remote IP of  incoming connections accepted by a listener.

Fixed a bug in the log writer so we append a newline.

This also updates to the latest go toolchain and tailscale version.

Signed-off-by: Jonathan Nobels <[email protected]>
@barnstar barnstar force-pushed the barnstar/swift-bindings branch from a28e351 to f0921b4 Compare January 2, 2025 19:33
@barnstar barnstar merged commit 2948fe1 into main Jan 2, 2025
3 checks passed
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.

3 participants