Agent Skills › GoogleCloudPlatform/scion › scion-web-serving

scion-web-serving

GitHub

指导在 Agent 内通过 Hub 端口代理暴露 HTTP/WS 服务,包括 scion expose/tunnel 命令使用、URL 分发及限制说明。

resources/platform_skills/scion-web-serving/SKILL.md GoogleCloudPlatform/scion

触发场景

需要暴露本地 Web 服务供外部访问 配置 Agent 内部服务的网络代理

安装

npx skills add GoogleCloudPlatform/scion --skill scion-web-serving -g -y
更多选项

非标准路径

npx skills add https://github.com/GoogleCloudPlatform/scion/tree/main/resources/platform_skills/scion-web-serving -g -y

不安装直接使用

npx skills use GoogleCloudPlatform/scion@scion-web-serving

指定 Agent (Claude Code)

npx skills add GoogleCloudPlatform/scion --skill scion-web-serving -a claude-code -g -y

安装 repo 全部 skill

npx skills add GoogleCloudPlatform/scion --all -g -y

预览 repo 内 skill

npx skills add GoogleCloudPlatform/scion --list

SKILL.md

Frontmatter
{
    "name": "scion-web-serving",
    "description": "How to serve a web page, app, API or other HTTP service from inside your agent so a person or program can reach it through the Hub's port proxy: scion expose and unexpose, the URL to hand over, what the proxy carries, and scion tunnel for full apps. The link serves web protocols only; for a non-HTTP port, point the person to scion tunnel. Use before running scion expose. For web pages and apps, also read references\/web-apps.md."
}

Serving web content from your agent through the port proxy

Services inside your agent are not reachable from outside it. scion expose registers a local port with the Hub, which then serves it at a URL that people with access to your agent can open.

The link serves web protocols only (HTTP, and WebSockets where supported; see below). For a non-HTTP port (a database, a debugger, SSH or another TCP service), the person uses scion tunnel instead, and the port must stay exposed (see Full apps: scion tunnel).

Steps

  1. Run the service on 127.0.0.1 on a free port (1024 or above; 9810 and 18380 cannot be exposed). Only loopback services can be exposed.
  2. Run: scion expose <port> --label "<what it is>"
  3. Check it works the way the person will use it (see What the proxy carries; for pages, references/web-apps.md).
  4. Give the person the URL exactly as printed, including the trailing /. Do not hand out tokens, and do not build the URL by hand.

Commands

  • scion expose <port> --label "<what it is>" exposes a port and prints its URL. Exposing a port that is already exposed succeeds and prints the same URL; it does not change the label (unexpose and expose again to relabel).
  • scion expose --list lists your exposed ports with their labels and URLs, and whether auto-expose is on.
  • scion unexpose <port> stops exposing a port. It succeeds if the port was not exposed. If auto-expose is on, a port that is still listening may be exposed again on its next scan.
  • An agent can have at most 10 ports exposed at once. Unexpose ports you no longer need.
  • These commands work only inside an agent with a Hub connection.

What the proxy carries

  • HTTP requests of any method, with the path below the URL and the query string passed through to your service. Programs such as scripts and curl can call the URL too, with the Hub credentials of someone who has access to the agent.
  • Your service does not learn who is calling. Do not build a login on top of the link.
  • WebSockets and streamed responses (for example server-sent events) work only when the Hub runs its conduit transport, the same setting scion tunnel needs. Without it, a WebSocket request is refused with an error, each response is delivered whole once your service has finished it, and request bodies are limited to 32 MiB.
  • Your service must start answering within 60 seconds (the Hub's default), or the caller gets a timeout error. Without the conduit transport, the whole response must arrive within that time.
  • What a page opened in a browser through the link can load depends on the Hub: with its page view on, the page's relative URLs load; with it off, the page can only use what is inside it. See references/web-apps.md before serving a web page or app.

Full apps: scion tunnel

For a full multi-file web app, a dev server, or anything the proxy does not carry, the person can run scion tunnel on their own machine with the scion CLI, if their Hub has scion tunnel turned on and they have port access to the agent. Keep the port exposed with scion expose <port> (the tunnel only reaches exposed ports), then suggest:

scion tunnel <agent> --port <port>

The service then opens on a local port on their machine and works as it does inside the agent, for any protocol. See https://googlecloudplatform.github.io/scion/hosted/user/port-forwarding/

Web pages and apps

For anything a person opens in a browser through the link, read references/web-apps.md: what loads with and without the Hub's page view, build settings, what does not work in a page, routing, and how to verify it honestly.

版本历史

  • ab9a0ef 当前 2026-11-03 02:34

同 Skill 集合

.scion/templates/web-dev/skills/chrome-devtools/SKILL.md
resources/platform_skills/git-operations/SKILL.md
resources/platform_skills/git-sandbox/SKILL.md
resources/platform_skills/scion-agent-manage/SKILL.md
resources/platform_skills/scion-cli-operations/SKILL.md
resources/platform_skills/scion-conversation/SKILL.md
resources/platform_skills/scion-messaging/SKILL.md
resources/platform_skills/scion-scheduler/SKILL.md
resources/platform_skills/team-creation/SKILL.md

元信息

文件数
0
版本
ab9a0ef
Hash
ae4a3614
收录时间
2026-11-03 02:34

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-11-03 12:30
浙ICP备14020137号-1