warp

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package warp registers a free Cloudflare WARP account and returns the WireGuard parameters Xray needs to use it as an outbound. The flow mirrors wgcf: generate a Curve25519 keypair, POST the public key to Cloudflare's device-registration API, and read back the assigned addresses + client id.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	PrivateKey    string // our WG secret key (base64), used as Xray secretKey
	PeerPublicKey string // Cloudflare's WG public key (base64)
	Endpoint      string // host:port of the WARP peer
	AddressV4     string // assigned interface IPv4 (no mask)
	AddressV6     string // assigned interface IPv6 (no mask)
	Reserved      []int  // 3-byte client id, Xray's "reserved"
}

Account holds everything needed to build a WireGuard outbound to WARP.

func Register

func Register(ctx context.Context) (*Account, error)

Register provisions a new WARP account and returns its WireGuard parameters.

Jump to

Keyboard shortcuts

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