# xoyoxoyo/relayapi architecture

> Architecture diagram of the GitHub repository xoyoxoyo/relayapi, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/xoyoxoyo/relayapi
- Repository: https://github.com/xoyoxoyo/relayapi

## Overview

Psyduck is a containerized IPv6 relay service, intended to provide an IPv6-capable endpoint for scripts configured with relay URLs. The documented workflow is to choose the executable matching the host architecture, run containers in either LAN-IP or FRP mode, add their URLs to a relay-group configuration, and verify IPv6 access on port 24678 or the forwarded port. The README documents these modes and helper-script usage; no source excerpts were provided, so internal runtime calls and script behavior beyond those statements are not mapped.

Main entry points: [`y.sh`](https://github.com/xoyoxoyo/relayapi/blob/main/y.sh) (FRP mode helper), [`x.sh`](https://github.com/xoyoxoyo/relayapi/blob/main/x.sh) (IP mode helper), [`psyduck-amd64`](https://github.com/xoyoxoyo/relayapi/blob/main/psyduck-amd64) (AMD64 executable), [`psyduck-arm`](https://github.com/xoyoxoyo/relayapi/blob/main/psyduck-arm) (ARM executable)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_provision["Container setup"]
  node_xscript["IP mode helper<br/>[x.sh]"]
  node_yscript["FRP mode helper<br/>[y.sh]"]
  node_docker["Docker host"]
end

subgraph group_runtime["Relay runtime"]
  node_amd64["AMD64 executable"]
  node_arm["ARM executable"]
  node_arm64["ARM64 executable"]
  node_armv7["ARMv7 executable"]
  node_relay["Relay endpoint"]
end

subgraph group_consumer["Relay configuration"]
  node_proxyini["Relay groups"]
end

node_operator(("Operator"))
node_frps["FRPS server"]
node_script["Consumer script"]
node_ipv6["IPv6 network"]

node_operator -->|"runs for IP mode"| node_xscript
node_operator -->|"runs for FRP mode"| node_yscript
node_xscript -->|"creates containers"| node_docker
node_yscript -->|"creates containers"| node_docker
node_operator -->|"builds and runs"| node_docker
node_docker -->|"runs selected executable"| node_amd64
node_docker -->|"runs selected executable"| node_arm
node_docker -->|"runs selected executable"| node_arm64
node_docker -->|"runs selected executable"| node_armv7
node_amd64 -->|"serves endpoint"| node_relay
node_arm -->|"serves endpoint"| node_relay
node_arm64 -->|"serves endpoint"| node_relay
node_armv7 -->|"serves endpoint"| node_relay
node_yscript -->|"configures address and token"| node_frps
node_operator -->|"adds relay URLs"| node_proxyini
node_script -->|"reads relay groups"| node_proxyini
node_script -->|"uses configured URL"| node_relay
node_relay -->|"verifies IPv6 access"| node_ipv6

click node_xscript "https://github.com/xoyoxoyo/relayapi/blob/main/x.sh"
click node_yscript "https://github.com/xoyoxoyo/relayapi/blob/main/y.sh"
click node_amd64 "https://github.com/xoyoxoyo/relayapi/blob/main/psyduck-amd64"
click node_arm "https://github.com/xoyoxoyo/relayapi/blob/main/psyduck-arm"
click node_arm64 "https://github.com/xoyoxoyo/relayapi/blob/main/psyduck-arm64"
click node_armv7 "https://github.com/xoyoxoyo/relayapi/blob/main/psyduck-armv7"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_xscript,node_yscript,node_docker toneBlue
class node_amd64,node_arm,node_arm64,node_armv7,node_relay toneAmber
class node_proxyini,node_frps toneMint
class node_operator,node_script,node_ipv6 toneIndigo
```

## Components

### Container setup

- [IP mode helper](https://github.com/xoyoxoyo/relayapi/blob/main/x.sh): `x.sh`
- [FRP mode helper](https://github.com/xoyoxoyo/relayapi/blob/main/y.sh): `y.sh`
- **Docker host**

### Relay runtime

- [AMD64 executable](https://github.com/xoyoxoyo/relayapi/blob/main/psyduck-amd64): `psyduck-amd64`
- [ARM executable](https://github.com/xoyoxoyo/relayapi/blob/main/psyduck-arm): `psyduck-arm`
- [ARM64 executable](https://github.com/xoyoxoyo/relayapi/blob/main/psyduck-arm64): `psyduck-arm64`
- [ARMv7 executable](https://github.com/xoyoxoyo/relayapi/blob/main/psyduck-armv7): `psyduck-armv7`
- **Relay endpoint**

### Relay configuration

- **Relay groups**

### Other components

- **Operator**
- **FRPS server**
- **Consumer script**
- **IPv6 network**

## Connections

- Operator → IP mode helper: runs for IP mode (evidence: `README.md`)
- Operator → FRP mode helper: runs for FRP mode (evidence: `README.md`)
- IP mode helper → Docker host: creates containers (evidence: `README.md`)
- FRP mode helper → Docker host: creates containers (evidence: `README.md`)
- Operator → Docker host: builds and runs (evidence: `README.md`)
- Docker host → AMD64 executable: runs selected executable (evidence: `README.md`)
- Docker host → ARM executable: runs selected executable (evidence: `README.md`)
- Docker host → ARM64 executable: runs selected executable (evidence: `README.md`)
- Docker host → ARMv7 executable: runs selected executable (evidence: `README.md`)
- AMD64 executable → Relay endpoint: serves endpoint (evidence: `README.md`)
- ARM executable → Relay endpoint: serves endpoint (evidence: `README.md`)
- ARM64 executable → Relay endpoint: serves endpoint (evidence: `README.md`)
- ARMv7 executable → Relay endpoint: serves endpoint (evidence: `README.md`)
- FRP mode helper → FRPS server: configures address and token (evidence: `README.md`)
- Operator → Relay groups: adds relay URLs (evidence: `README.md`)
- Consumer script → Relay groups: reads relay groups (evidence: `README.md`)
- Consumer script → Relay endpoint: uses configured URL (evidence: `README.md`)
- Relay endpoint → IPv6 network: verifies IPv6 access (evidence: `README.md`)
