需要 go 工具链版本 >= 1.11(使用 go modules);与官方 Python 版互通时需对方也运行 magic wormhole;默认使用公共 rendezvous relay,可用 --relay-url 指定
wormhole-william
psanfordMIT活跃维护用 Go 实现的 Magic Wormhole 命令行工具和 API,通过一次性口令建立端到端加密通道,安全地把文件传给对方。
End-to-end encrypted file transfer. A magic wormhole CLI and API in Go (golang).
go install github.com/psanford/wormhole-william@latestREADME 未说明
Go 实现的 magic wormhole,用同一口令在两台电脑间做端到端加密传文件
用 Go 实现的 Magic Wormhole 命令行工具和 API,通过一次性口令建立端到端加密通道,安全地把文件传给对方。
核心能力
- 用同一 wormhole code 连接两端并端到端加密传输
- 支持发送和接收文本、文件与目录
- 兼容官方 Python magic wormhole CLI
- 提供 Go API 供程序集成,附 CLI 与示例
- CLI 支持 shell 补全,含接收码补全
容易踩的坑
- v1.0.8最新正式版2025-03-30 · 2025-03-30 02:49 UTC
- Fix for macports build #112
- Upgrade dependencies
- v1.0.72023-08-17 · 2023-08-17 00:42 UTC
查看更新说明
This release has a number of minor improvements:
- Fix receive to not hang on empty file transfers #78
- Fix handling of duplicate hint addrs and don't send duplicate hint addrs. This could cause a go-routine leak and receivers to hang #89
- Some minor third party updates and code changes
- v1.0.62021-12-19 · 2021-12-19 01:03 UTC
查看更新说明
Library/core changes:
- Added better support for file transfer cancellation #38 #40 #50
- Switched to nhooyr.io/websocket for websocket implementation #44
- Add recv-dir code example #33
- Fix compatibility issue with rust implementation #59
- Set TransferBytes64 and UncompressedBytes64 for text messages #62
CLI changes:
- Add experimental qr code support to cli #37
- Fix cli unit inconsistency between SI and IEC #51
- v1.0.52021-03-13 · 2021-03-13 17:59 UTC
查看更新说明
API Changes:
- Add minimal support for WithProgress to SendText (f69f6e82)
CLI Changes:
- Add shell completions including tab completion for receive codes (2cf5dcc686)
- Switch to using
klauspost/compressfor zip performance improvements (0f823706c5) (thanks @Jacalz )
- v1.0.42020-07-12 · 2020-07-12 17:45 UTC
查看更新说明
API Changes:
- The fields on
wormhole.IncomingMessage:TransferBytesandUncompressedByteshave been deprecated in favor ofTransferBytes64andUncompressedBytes64. This allows for transfers >2GB on 32bit systems. The old fields remain for backwards compatibility.
Bug Fixes:
-
Fix sending files > 2GB on 32bit systems (thanks @gnyman)
-
Fix sending directories on Windows (thanks @rixtox)
-
Code hygiene fixes (thanks @Jacalz)
CLI Changes:
- None
- The fields on
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
wormhole-william
wormhole-william is a Go (golang) implementation of magic wormhole. It provides secure end-to-end encrypted file transfers between computers. The endpoints are connected using the same "wormhole code".
wormhole-william is compatible with the official python magic wormhole cli tool.
Currently, wormhole-william supports:
- sending and receiving text over the wormhole protocol
- sending and receiving files over the transit protocol
- sending and receiving directories over the transit protocol
Docs
https://pkg.go.dev/github.com/psanford/wormhole-william/wormhole?tab=doc
CLI Usage
$ wormhole-william send --help
Send a text message, file, or directory...
Usage:
wormhole-william send [WHAT] [flags]
Flags:
--code string human-generated code phrase
-c, --code-length int length of code (in bytes/words)
-h, --help help for send
--hide-progress suppress progress-bar display
-v, --verify display verification string (and wait for approval)
Global Flags:
--relay-url string rendezvous relay to use
$ wormhole-william receive --help
Receive a text message, file, or directory...
Usage:
wormhole-william receive [code] [flags]
Aliases:
receive, recv
Flags:
-h, --help help for receive
--hide-progress suppress progress-bar display
-v, --verify display verification string (and wait for approval)
Global Flags:
--relay-url string rendezvous relay to use
CLI tab completion
The wormhole-william CLI supports shell completion, including completing the receive code.
To enable shell completion follow the instructions from wormhole-william shell-completion -h.
Building the CLI tool
wormhole-william uses go modules so it requires a version of the go tool chain >= 1.11. If you are using a version of go that supports modules you can clone the repo outside of your GOPATH and do a go build in the top level directory.
To just install via the go tool run:
go install github.com/psanford/wormhole-william@latest
API Usage
Sending text:
package main
import (
"context"
"fmt"
"io/ioutil"
"log"
"github.com/psanford/wormhole-william/wormhole"
)
func sendText() {
var c wormhole.Client
msg := "Dillinger-entertainer"
ctx := context.Background()
code, status, err := c.SendText(ctx, msg)
if err != nil {
log.Fatal(err)
}
fmt.Println("On the other computer, please run: wormhole receive")
fmt.Printf("Wormhole code is: %s\n", code)
s := <-status
if s.OK {
fmt.Println("OK!")
} else {
log.Fatalf("Send error: %s", s.Error)
}
}
func recvText(code string) {
var c wormhole.Client
ctx := context.Background()
msg, err := c.Receive(ctx, code)
if err != nil {
log.Fatal(err)
}
if msg.Type != wormhole.TransferText {
log.Fatalf("Expected a text message but got type %s", msg.Type)
}
msgBody, err := ioutil.ReadAll(msg)
if err != nil {
log.Fatal(err)
}
fmt.Println("got message:")
fmt.Println(msgBody)
}
See the cli tool and examples directory for working examples of how to use the API to send and receive text, files and directories.
Third Party Users of Wormhole William
- rymdport: A cross-platform Magic Wormhole graphical user interface
- riftshare: Desktop filesharing app
- termshark: A terminal UI for tshark
- tmux-wormhole: tmux wormhole integration
- wormhole-william-mobile: Android wormhole-william app