Logo di Wildcard Proxy

Wildcard Proxy

Community
koolamusic
wildcard-proxy

Set up Caddy on a server so any local port is reachable at https://<port>.<domain>/, and two-letter or named labels like https://ui.<domain>/ map to ports too, with certificates issued on demand and gated so only routed hostnames get one. Use when the user says 'set up the wildcard proxy', 'port routing on this server', 'configure caddy so ports get subdomains', 'add a short name for port N', 'what port is ab', or is preparing a new server to expose local services by port.

Panoramica

Autorekoolamusic
Repositoryclaudefiles
Nome della skillwildcard-proxy
Stelle
121
Fork
14
File inclusi
2
LicenzaMIT
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • 2 file inclusi

    Script, modelli di documento e riferimenti che il modello può leggere mentre lavora. I file sono di sola lettura e non vengono mai eseguiti.

  • Open source

    Pubblicata da koolamusic su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Wildcard Proxy in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/koolamusic/claudefiles/tree/main/skills/wildcard-proxy
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Nuova skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella nella cartella delle skill di quell'agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/koolamusic/claudefiles.git /tmp/claudefiles
mkdir -p .claude/skills
cp -r /tmp/claudefiles/skills/wildcard-proxy .claude/skills/wildcard-proxy
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Wildcard Proxy in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Wildcard Proxy non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Wildcard Proxy non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

Wildcard Proxy

One Caddy config, installed once per server, that routes https://<label>.<domain>/ to 127.0.0.1:<port>. After install, exposing a service is just binding it to a loopback port. A short name is one line in a names file.

How a label becomes a port

Checked in this order; first match wins.

LabelRuleExample
short namelisted in wildcard-proxy.namesui → 4001
port numbermatches the allowed port regex4012 → 4012
any two letters1 + two-digit alphabet position of each letter (a=00 … z=25)ab → 10001, hz → 10725, zz → 12525

The computed range is 10000–12525. Port for letters xy = 10000 + 100·pos(x) + pos(y). A short name overrides that name's computed port: ui would otherwise be 12008.

Anything else (abc, a1, 3000 outside the ranges, deeper subdomains) gets no certificate and no route.

Inputs

PlaceholderMeaningDefault
{{DOMAIN}}the wildcard parent, e.g. host.example.netask the user
{{DOMAIN_RE}}same, dots escapedderived
{{PORT_RE}}allowed numeric labels, as regex alternatives40[0-9][0-9]|80[0-9][0-9] (4000–4099, 8000–8099)
{{ASK_PORT}}loopback port for the certificate gate5555

Use [0-9][0-9], not [0-9]{2}, in PORT_RE. Caddyfile braces look like placeholders.

Prerequisites — check before installing

  1. Caddy v2 installed and running as a systemd service: caddy version, systemctl is-active caddy.

  2. Wildcard DNS: *.{{DOMAIN}} resolves to this server. Check with a label nobody has used: dig +short zq.{{DOMAIN}} should print the server's public IP (curl -4 -s ifconfig.me; also check dig +short AAAA if the server has IPv6).

  3. Ports 80 and 443 reachable from the internet and not held by another server: sudo ss -tlnp '( sport = :80 or sport = :443 )'.

  4. No other on_demand_tls block in /etc/caddy/Caddyfile. Caddy allows one ask endpoint. If one exists, stop and ask the user. Merging two gates is a design decision. The exception is an older inline version of this same config: replace it with the import, and keep the static sites.

  5. ASK_PORT free: ss -tln | grep ':{{ASK_PORT}} ' prints nothing, or only Caddy itself when migrating an older version of this config.

  6. Nothing private already listening on a routable port. After install, anything bound to loopback on a routed port is public. Before install, list what is already there:

    bash
    ss -tlnp | awk 'NR>1{n=split($4,a,":"); p=a[n]; if ((p>=4000&&p<=4099)||(p>=8000&&p<=8099)||(p>=10000&&p<=12525&&p%100<=25&&int(p/100)%100<=25)) print $4, $6}'

    Show the user every hit and confirm each one is meant to be public. Default ports in the computed range include memcached's 11211 (ml) and Webmin's 10000 (aa).

Install

Templates are in references/ beside this file.

1. Back up the live config.

bash
sudo cp /etc/caddy/Caddyfile /etc/caddy/Caddyfile.bak-$(date +%F)

2. Render the site file. From this skill's references/ directory:

bash
DOMAIN=host.example.net
DOMAIN_RE=$(printf '%s' "$DOMAIN" | sed 's/\./\\\\./g')
sed -e "s/{{DOMAIN}}/$DOMAIN/g" -e "s/{{DOMAIN_RE}}/$DOMAIN_RE/g" \
    -e 's/{{PORT_RE}}/40[0-9][0-9]|80[0-9][0-9]/g' -e 's/{{ASK_PORT}}/5555/g' \
    wildcard-proxy.caddy > /tmp/wildcard-proxy.caddy

Confirm no placeholder survived: grep -c '{{' /tmp/wildcard-proxy.caddy prints 0. Confirm the regex line reads host\.example\.net, with single backslashes.

3. Place both files. Don't overwrite an existing names file. It holds the user's names.

bash
sudo install -m 644 /tmp/wildcard-proxy.caddy /etc/caddy/wildcard-proxy.caddy
sudo cp -n wildcard-proxy.names /etc/caddy/wildcard-proxy.names

4. Wire it into the main Caddyfile. The global options block must be the first thing in the file. Add the on_demand_tls lines to it, creating the block if absent, and put the import anywhere after:

{
	on_demand_tls {
		ask http://127.0.0.1:5555/ask
	}
}

import wildcard-proxy.caddy

On a fresh install, remove the packaged welcome-page :80 { … } block. It catches every plain-HTTP request.

5. Validate, then reload. Never reload an unvalidated config.

bash
sudo caddy validate --config /etc/caddy/Caddyfile --adapter caddyfile
bash
sudo systemctl reload caddy

Verify

Gate — every routed label returns 200, everything else 403:

bash
for l in 4012 ab zz 3000 abc; do printf '%s %s\n' $l "$(curl -s -o /dev/null -w '%{http_code}' "http://127.0.0.1:5555/ask?domain=$l.$DOMAIN")"; done

Expected: 4012 200, ab 200, zz 200, 3000 403, abc 403.

Gate is loopback-only — ss -tln | grep ':5555 ' shows 127.0.0.1:5555, not *:5555.

End to end — serve something on a loopback port and fetch it publicly:

bash
python3 -m http.server 4012 --bind 127.0.0.1
bash
curl -s -o /dev/null -w '%{http_code}\n' https://4012.$DOMAIN/

200 means it works. The first request to a new hostname triggers certificate issuance and can fail once with 000. Wait a few seconds and retry once before diagnosing.

Add a short name

Append <label> <port> to /etc/caddy/wildcard-proxy.names. Labels use lowercase letters, digits, and hyphens. Then validate and reload as in install step 5. Check that the label returns 200 from the gate.

To answer "what port is xy": check the names file first, then compute 10000 + 100·pos(x) + pos(y).

Rules for services behind it

  • Bind to 127.0.0.1, never 0.0.0.0. Caddy must be the only way in. A 0.0.0.0 bind exposes the service on the raw IP without TLS.
  • Scan before picking a port: ss -tln. Don't trust a remembered list.
  • Watch for static sites that share a port. A Caddyfile entry like cloud.example.net { reverse_proxy 127.0.0.1:4040 } means 4040 is taken even though it matches the range. Grep the Caddyfile for reverse_proxy 127.0.0.1: before choosing.
  • A static site block for x.{{DOMAIN}} wins over the wildcard. That's intended, but it means the names file doesn't control that label.
  • Everything is public and unauthenticated. The hostnames are guessable. Say so once before exposing anything sensitive.

Known limits

  • Certificate rate limits. About 900 hostnames can request a certificate: 200 numeric, 676 two-letter, plus names. Anyone who knows the scheme can trigger issuance for all of them and exhaust the CA's per-domain weekly limit, which blocks new certificates until it resets. Hostnames that already have certificates keep working. The full fix is a single wildcard certificate via the DNS challenge, which needs a Caddy build with the DNS provider's module. Offer it, don't do it unasked.
  • Caddy map quirks the template works around. Do not "simplify" these away:
    • Map outputs don't expand placeholders. 1{wp_da}{wp_db} as a map output stays literal, so the computed port is built inside reverse_proxy.
    • Map converts bare numeric outputs to integers. Unquoted 01 becomes 1, so ab dials port 101. The alphabet digits stay quoted.
    • The label is extracted by a regex on the full host, not {labels.N}. Label indices shift with domain depth.

File inclusi

Il modello legge questi file quando servono, mentre la skill è caricata. Sono accessibili in sola lettura e non vengono mai eseguiti.

Domande frequenti

Cosa fa la skill IA Wildcard Proxy?

Set up Caddy on a server so any local port is reachable at https://<port>.<domain>/, and two-letter or named labels like https://ui.<domain>/ map to ports too, with certificates issued on demand and gated so only routed hostnames get one. Use when the user says 'set up the wildcard proxy', 'port routing on this server', 'configure caddy so ports get subdomains', 'add a short name for port N', 'what port is ab', or is preparing a new server to expose local services by port.

Perché usare Wildcard Proxy su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Wildcard Proxy è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Wildcard Proxy in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/koolamusic/claudefiles/tree/main/skills/wildcard-proxy. TypingMind legge il file SKILL.md, include i file associati e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Wildcard Proxy?

Qualsiasi modello che colleghi in TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Wildcard Proxy?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Wildcard Proxy: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Wildcard Proxy è gratuita?

Sì. È pubblicata su GitHub da koolamusic con licenza MIT. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, modelli o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Vedi tutti

Crea subito la tua area di lavoro IA

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇