-
-
Notifications
You must be signed in to change notification settings - Fork 82.1k
[Feature]: node run --context-path for reverse-proxied gateways #97678
Copy link
Copy link
Closed
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.enhancementNew feature or requestNew feature or requestimpact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maturity:stableBroken existing behavior primarily owned by an M4/M5 scorecard surface.Broken existing behavior primarily owned by an M4/M5 scorecard surface.
Description
Activity
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.enhancementNew feature or requestNew feature or requestimpact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maturity:stableBroken existing behavior primarily owned by an M4/M5 scorecard surface.Broken existing behavior primarily owned by an M4/M5 scorecard surface.
Type
Fields
Priority
None yet
Summary
Add
--context-pathflag toopenclaw node runandopenclaw node installso nodes can connect to gateways behind a reverse proxy with a path prefix.Problem to solve
When an OpenClaw gateway is exposed through a reverse proxy (nginx, Caddy, Cloudflare Tunnel, etc.), the WebSocket endpoint often lives at a path like
wss://gateway.example.com/openclaw-gwrather than at the root. Currentlyopenclaw node runonly accepts--hostand--port, assembling the URL asws://host:portwith no path component. This makes it impossible for remote nodes to connect to gateways behind path-routed proxies.Workarounds like host-header routing or dedicated ports add operational complexity and are not always possible in shared proxy environments.
Proposed solution
Add a
--context-pathoption toopenclaw node runandopenclaw node install:Desired behavior:
--context-pathvalue is appended directly to the WebSocket URL:${scheme}://${host}:${port}${contextPath}/, one is prepended automatically (e.g.gwsbecomes/gws)ws://host:port(backward compatible)node.jsonso subsequentnode runwithout--context-pathreuses the last valueopenclaw node install --context-path /gwsincludes it in the daemon's persisted CLI args so the background service reconnects correctlyAlternatives considered
OPENCLAW_GATEWAY_CONTEXT_PATH): feasible but inconsistent with how--hostand--portare exposed as CLI flags. CLI flags are preferred for daemon install arg persistence.Impact
Evidence/examples
Nginx reverse proxy example that would require this:
Cloudflare Tunnel with path-based routing to multiple gateway instances would also require a non-root WebSocket path.
Additional information
--context-pathcontinue to connect atws://host:portwithout a path./guard is applied; trailing slashes are preserved as-is so users have full control over the URL shape.contextPathis not sent to the gateway server — it is purely a client-side connection parameter for WebSocket URL assembly.fix/feishu-dmpolicy-docs... (can be updated per actual PR branch)