Skip to content

Commit e77874b

Browse files
committed
docs: add proxied: false documentation for preview environments
1 parent 816b575 commit e77874b

1 file changed

Lines changed: 36 additions & 1 deletion

File tree

docs/roo-code-cloud/environments.mdx

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ keywords:
1414
- mise
1515
- Initial Path
1616
- Subdomain Routing
17+
- Proxied Ports
18+
- Direct Port Access
1719
---
1820

1921
# Preview Environments
@@ -91,6 +93,7 @@ ports:
9193
|-------|-------------|----------|
9294
| `name` | Identifier for the port (used to generate environment variables) | Yes |
9395
| `port` | The port number to expose | Yes |
96+
| `proxied` | Whether traffic goes through the auth proxy (`true` by default). Set to `false` for direct port access (see [Direct Port Access](#direct-port-access-non-proxied)) | No |
9497
| `initial_path` | Default path to append to the preview URL | No |
9598
| `subdomain` | Subdomain to set on the `Host` header when forwarding requests to the app | No |
9699

@@ -113,7 +116,10 @@ The name is converted to uppercase for the environment variable (e.g., `web` bec
113116

114117
### Limits
115118

116-
You can configure up to **4 named ports** per environment.
119+
Port limits depend on whether ports are proxied (default) or non-proxied:
120+
121+
- **Proxied ports** (default): up to **10** per environment. These share a single internal port slot via multiplexing.
122+
- **Non-proxied ports** (`proxied: false`): up to **1** per environment. Each non-proxied port consumes a dedicated port slot.
117123

118124
### Initial Path
119125

@@ -189,6 +195,35 @@ Invalid examples:
189195
- **Admin panels**: Serve an admin interface on `admin.localhost:3000` while the main app runs on the root domain
190196
- **Subdomain APIs**: Frameworks like Rails can use `api.localhost:3000` to route API requests to a separate controller namespace
191197

198+
### Direct Port Access (Non-Proxied)
199+
200+
By default, all ports are proxied through an authentication layer that validates requests before forwarding them to your application. Setting `proxied: false` bypasses this proxy and exposes the port directly on the sandbox domain.
201+
202+
```yaml
203+
ports:
204+
- name: WEB
205+
port: 3000
206+
- name: METRICS
207+
port: 9090
208+
proxied: false
209+
```
210+
211+
Use `proxied: false` when you need:
212+
213+
- **Direct socket access** for protocols that don't work well through the HTTP proxy
214+
- **Internal services** that handle their own authentication or don't need external access control
215+
216+
:::warning[Warning]
217+
When `proxied` is `false`, the port is **completely exposed without authentication**, regardless of the `unauthenticated` setting. Only use this for ports that either handle their own security or don't serve sensitive content.
218+
:::
219+
220+
The `ROO_<NAME>_HOST` environment variable for a non-proxied port points to the direct sandbox domain instead of the preview proxy URL. Your application code doesn't need to change -- just use the injected variable as usual:
221+
222+
```typescript
223+
// Works the same whether the port is proxied or not
224+
const metricsUrl = process.env.ROO_METRICS_HOST || 'http://localhost:9090';
225+
```
226+
192227
## Using Environment Variables in Your Code
193228

194229
Use the `ROO_<NAME>_HOST` variables instead of hardcoded URLs so your services can find each other in both preview and local environments:

0 commit comments

Comments
 (0)