webexec is a terminal server running over WebRTC with support for signaling over SSH or HTTP. It listens for connection requests, executes commands over pseudo ttys, and pipes their I/O over WebRTC data channels.
- Language: Go (module
github.com/tuzig/webexec, Go 1.25+) - Build system:
go build,go generate(usesgo-gitverfor versioning) - Test framework: Go standard
testing+stretchr/testify - Task runner:
just(seeJustfile)
# Bootstrap (verify Go, install go-gitver)
just bootstrap
# Install dependencies
just install # or: go mod download
# Run linter & formatter checks
just lint # or: go vet ./... && gofmt -l -s .
# Run all tests (verbose, 120s timeout)
just test # or: go test ./... -v -timeout 120s
# Build the binary (runs go generate then go build)
just build # or: go generate ./... && go build -o webexec .
# Run the server
just run # or: ./webexec
# Clean build artifacts
just clean # or: rm -f webexec && go clean -cache -testcachego generate ./...must be run before building — it generates version info viago-gitver(see//go:generatedirective inwebexec.go).- The binary output is named
webexecand placed in the repo root. - Build tags are used for platform-specific files (e.g.,
dup2_wrapper.govsdup2_wrapper_armlinux.go,pidfilepackage).
- Follow
gofmtformatting (usegofmt -sfor simplification). - Run
go vet ./...before submitting — no warnings allowed. - Package
maincontains the server entry point and core logic. Sub-packages:httpserver,peers,pidfile. - Tests live alongside source files (
*_test.go). Some test files use//go:build ignoreand are excluded from normal test runs (e.g.,session_test.go). - Integration tests are under
aatp/— run with./aatp/test.
- TCP 7777 — HTTP signaling server (default:
127.0.0.1:7777). - UDP 60000–61000 — WebRTC data channel range.
- When running inside a sandbox,
host.containers.internalis used to reach services on the host.
- Config file is TOML format, sections:
[log],[net],[timeouts],[ice_servers],[env],[peerbook]. - Default config is embedded in
conf.go. - Env vars:
PEERBOOK_UID,PEERBOOK_HOST,PEERBOOK_NAMEfor PeerBook integration.