tailscale

command
v0.0.0-...-5699ccb Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: MIT, BSD-3-Clause Imports: 34 Imported by: 0

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 -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