Przejdź do treści
Biblioteka skilli
DevOps i chmura · Automatyzacja

lan-proxy-gateway-ops

/lan-proxy-gateway-ops

Konfiguruje bramę LAN proxy z poziomu skryptu: źródło subskrypcji, przełączanie węzłów, tryb TUN i reguły routingu.

Licencja
MIT
Ostatnia zmiana repozytorium
04.11.2026

Ocena i bezpieczeństwo

90/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść25 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
2
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 04.11.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Konfiguruje bramę LAN proxy z poziomu skryptu: źródło subskrypcji, przełączanie węzłów, tryb TUN i reguły routingu.

Oryginalny opis (EN)

Use when operating or configuring the lan-proxy-gateway CLI (the `gateway` binary) non-interactively — setting the proxy source/subscription, switching nodes, toggling TUN/adblock/traffic mode, adding routing rules, reading status, or starting/stopping the LAN gateway from a script or AI agent without driving the interactive TUI.

Jak działa

  1. Overview
  2. Workflow
  3. Command Reference
  4. Privileges
  5. Common Mistakes
  6. Scenarios
Sekcje z nagłówków SKILL.md, w oryginale · 68 linii, 540 słów
Podgląd SKILL.md
---
name: lan-proxy-gateway-ops
description: Use when operating or configuring the lan-proxy-gateway CLI (the `gateway` binary) non-interactively — setting the proxy source/subscription, switching nodes, toggling TUN/adblock/traffic mode, adding routing rules, reading status, or starting/stopping the LAN gateway from a script or AI agent without driving the interactive TUI.
---

# LAN Proxy Gateway Ops

## Overview

`lan-proxy-gateway` (binary: `gateway`) turns a Mac/Linux/Windows machine into a LAN transparent proxy gateway on top of mihomo. It can be driven **entirely from the command line** — no interactive TUI required. Every `config` write saves `gateway.yaml` and **hot-reloads mihomo if it is running**, so changes apply live.

This skill is the command reference for operating it headlessly.

## Workflow

1. **Read** current state: `gateway status --json` and `gateway config show --json`.
2. **Change** config with `gateway config ...` (or `gateway node ...` at runtime).
3. **Verify** by re-reading status/config.

All read + `config` commands work **without root**. Only `start`/`stop`/`restart` need root.

## Command Reference

### Read state (no root, machine-readable with `--json`)
- `gateway status --json` — running, mode, TUN, adblock, source type, ports
- `gateway config show --json` — full config incl. source url/path/server, custom rules
- `gateway node list --json` — proxy groups, their nodes, and the current pick *(needs the gateway running)*

`--json` output uses stable **snake_case** keys (`running`, `gateway_mode`, `tun`, …). `node`/`config show` errors are printed to stderr with a non-zero exit code (e.g. `网关未运行,先 gateway start`).

### Set the proxy source
- `gateway config source --type subscription --url <URL>`
- `gateway config source --type file --path <clash.yaml>`
- `gateway config source --type external --server 127.0.0.1 --port 7890 --kind http`  *(chain behind a local Clash/Verge)*
- `gateway config source --type remote --server <host> --port <p> --kind socks5 --user <u> --pass <pw>`
- `gateway config source --type none`  *(all direct)*

### Toggle behavior
- `gateway config mode <rule|global|direct>`
- `gateway config tun <on|off>`
- `gateway config adblock <on|off>`
- `gateway config gateway-mode <tun|forward>`  *(restarts mihomo)*

### Custom routing rules
- `gateway config rule add <direct|proxy|reject> <RULE>` — `<RULE>` is any mihomo rule body: `DOMAIN-SUFFIX,openai.com`, `DOMAIN,api.foo.com`, `IP-CIDR,10.0.0.0/8`, `PROCESS-NAME,Cursor`, `GEOIP,CN`, etc.
- `gateway config rule list --json`
- `gateway config rule rm <direct|proxy|reject> <index>` — index comes from `rule list`

### Switch nodes at runtime (needs the gateway running)
- `gateway node list`
- `gateway node switch "<group>" "<node>"` — quote names; groups/nodes contain spaces & emoji

### Lifecycle
- `gateway install` — first-run wizard: downloads mihomo + GeoIP, guides initial setup
- `gateway start` / `gateway stop` / `gateway restart` — **needs root** (TUN, IP forwarding, firewall)
- `gateway service install|uninstall|status` — OS service for auto-start on boot

## Privileges

`start`/`stop`/`restart` change the host network stack (TUN device, IP forwarding, pf/iptables) and need root. `status`, `config *`, and `node *` do **not**. If passwordless `sudo` is available, run `sudo gateway start` directly; otherwise tell the user to run it themselves. Never assume the machine should proxy its own traffic — check `gateway config show` (`tun`, `gateway_mode`) first.

## Common Mistakes

- Driving the interactive TUI (`gateway` with no args) by piping keystrokes — fragile. Use the headless `config`/`node` commands above instead.
- Running `node list/switch` when the gateway is stopped — they need mihomo's running API; start first.
- Forgetting to quote group/node names in `node switch` — they contain spaces and emoji.
- Editing `gateway.yaml` by hand while the gateway runs — prefer `config` commands so the change hot-reloads cleanly.

## Scenarios

For end-to-end recipes (LAN onboarding, point to a subscription then pick a node, local-machine bypass, health/recovery), read [references/scenarios.md](references/scenarios.md).
Pliki w paczce (2)
  • SKILL.md 4 KB
  • references/scenarios.md 2 KB

Wersje

W bazie nie ma innych skilli o nazwie lan-proxy-gateway-ops.

Migawka bazy z 13.11.2026 · wersja paczki a50cb52c8845 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 90clash-doctor
    Diagnozuje Clash Verge i mihomo: błędy proxy, routing dla narzędzi AI, tryb TUN i przełączanie subskrypcji.
  • 95api-gateway
    Pomaga projektować bramę API w Kong, Traefik lub AWS API Gateway: limity zapytań, uwierzytelnianie, routing i wersjonowanie.
  • 95lov-clash-tun-doctor
    Diagnozuje i naprawia problemy z łącznością aplikacji powodowane przez trasowanie TUN w Clash Verge Rev, kolejność reguł, nieaktualny stan, limity czasu proxy i niedziałające ścieżki IPv6.
  • 90konnect-ai-gateway
    Diagnozuje przepływ żądań, routing dostawców i modeli oraz analitykę LLM w Konnect AI Gateway.
  • 100first-run-lan-pairing-onboarding
    Paruje system agentów z routerami w sieci lokalnej: wiąże sekret instalacyjny, wyszukuje sąsiadów i przyjmuje hasła wyłącznie z LAN.
  • 100proxy-manager
    Zarządza proxy Webshare przez CLI webshare: lista aktywnych proxy, odświeżanie pul rotujących, konfiguracja, listy dozwolonych IP, adresy URL proxy, plany subskrypcji i zużycie.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.