tailscale

command
v0.0.0-...-f927c00 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2026 License: MIT, BSD-3-Clause Imports: 36 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Tailscale

A WASM client that allows connecting to your Headscale instance over ts2021 & DERP.

Build Golang WASM

[!IMPORTANT]
All commands are meant to be run from the root directory of this project.

To build inside Docker:

docker run -it --rm -v .:/work:rw --workdir /work golang:latest
# Inside container
apt update && apt install binaryen
Build initial binary
GOOS=js GOARCH=wasm go build -trimpath -ldflags "-s -w" -o ./package/tailscale/pkg/tailscale.wasm ./package/tailscale/tailscale.go
Optimize with binaryen
wasm-opt --enable-bulk-memory --enable-sign-ext --enable-nontrapping-float-to-int -Oz ./package/tailscale/pkg/tailscale.wasm -o ./package/tailscale/pkg/tailscale.wasm
Copy required helper functions
cp "$(go env GOROOT)/lib/wasm/wasm_exec.js" ./package/tailscale/pkg/wasm_exec.js

Could also be at $(go env GOROOT)/misc/wasm/wasm_exec.js

Documentation

Overview

The wasm package builds a WebAssembly module that provides a subset of Tailscale APIs to JavaScript.

When run in the browser, a newIPN(config) function is added to the global JS namespace. When called it returns an ipn object with the methods run(callbacks), login(), logout(), and ssh(...).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL