Skip to content

Commit b926698

Browse files
fix: use CONNECT tunnel for WebSocket endpoints in Discord/Slack presets
The egress proxy's HTTP idle timeout (~2 min) kills long-lived WebSocket connections when endpoints are configured with protocol:rest + tls:terminate. Switch WebSocket endpoints to access:full (CONNECT tunnel) which bypasses HTTP-level timeouts entirely. Discord: - gateway.discord.gg → access:full (WebSocket gateway) - Add PUT/PATCH/DELETE methods for discord.com (message editing, reactions) - Add media.discordapp.net for attachment access Slack: - Add wss-primary.slack.com and wss-backup.slack.com → access:full (Socket Mode WebSocket endpoints) Partially addresses #409 — the policy-level fix enables WebSocket connections to survive. The hardcoded 2-min timeout in openshell-sandbox still affects any protocol:rest endpoints with long-lived connections. Related: #361 (WhatsApp Web, same root cause)
1 parent ffdccaf commit b926698

2 files changed

Lines changed: 21 additions & 3 deletions

File tree

‎nemoclaw-blueprint/policies/presets/discord.yaml‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,25 @@ network_policies:
1717
rules:
1818
- allow: { method: GET, path: "/**" }
1919
- allow: { method: POST, path: "/**" }
20+
- allow: { method: PUT, path: "/**" }
21+
- allow: { method: PATCH, path: "/**" }
22+
- allow: { method: DELETE, path: "/**" }
23+
# WebSocket gateway — must use access:full (CONNECT tunnel) instead
24+
# of protocol:rest. The proxy's HTTP idle timeout (~2 min) kills
25+
# long-lived WebSocket connections; a CONNECT tunnel avoids
26+
# HTTP-level timeouts entirely. See #409.
2027
- host: gateway.discord.gg
28+
port: 443
29+
access: full
30+
- host: cdn.discordapp.com
2131
port: 443
2232
protocol: rest
2333
enforcement: enforce
2434
tls: terminate
2535
rules:
2636
- allow: { method: GET, path: "/**" }
27-
- allow: { method: POST, path: "/**" }
28-
- host: cdn.discordapp.com
37+
# Media/attachment uploads use a separate domain
38+
- host: media.discordapp.net
2939
port: 443
3040
protocol: rest
3141
enforcement: enforce

‎nemoclaw-blueprint/policies/presets/slack.yaml‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
preset:
55
name: slack
6-
description: "Slack API and webhooks access"
6+
description: "Slack API, Socket Mode, and webhooks access"
77

88
network_policies:
99
slack:
@@ -33,3 +33,11 @@ network_policies:
3333
rules:
3434
- allow: { method: GET, path: "/**" }
3535
- allow: { method: POST, path: "/**" }
36+
# Socket Mode WebSocket — requires CONNECT tunnel to avoid
37+
# HTTP idle timeout killing the persistent connection. See #409.
38+
- host: wss-primary.slack.com
39+
port: 443
40+
access: full
41+
- host: wss-backup.slack.com
42+
port: 443
43+
access: full

0 commit comments

Comments
 (0)