wormhole-william

psanfordMIT活跃维护

用 Go 实现的 Magic Wormhole 命令行工具和 API,通过一次性口令建立端到端加密通道,安全地把文件传给对方。

End-to-end encrypted file transfer. A magic wormhole CLI and API in Go (golang).

v1.0.8发布于 2025-03-30 02:49 UTC1,261star72fork同步于 2026-11-10 23:50 UTC

怎么上手

由 README 提炼,执行前请确认
go install github.com/psanford/wormhole-william@latest
硬件要求按 README 说明

README 未说明

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

Go 实现的 magic wormhole,用同一口令在两台电脑间做端到端加密传文件

用 Go 实现的 Magic Wormhole 命令行工具和 API,通过一次性口令建立端到端加密通道,安全地把文件传给对方。

核心能力

  • 用同一 wormhole code 连接两端并端到端加密传输
  • 支持发送和接收文本、文件与目录
  • 兼容官方 Python magic wormhole CLI
  • 提供 Go API 供程序集成,附 CLI 与示例
  • CLI 支持 shell 补全,含接收码补全

容易踩的坑

需要 go 工具链版本 >= 1.11(使用 go modules);与官方 Python 版互通时需对方也运行 magic wormhole;默认使用公共 rendezvous relay,可用 --relay-url 指定

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v1.0.8
  1. v1.0.8最新正式版2025-03-30 · 2025-03-30 02:49 UTC
    • Fix for macports build #112
    • Upgrade dependencies
  2. 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
  3. 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
  4. 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/compress for zip performance improvements (0f823706c5) (thanks @Jacalz )
  5. v1.0.42020-07-12 · 2020-07-12 17:45 UTC
    查看更新说明

    API Changes:

    • The fields on wormhole.IncomingMessage: TransferBytes and UncompressedBytes have been deprecated in favor of TransferBytes64 and UncompressedBytes64. 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

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    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