You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every Sprite has built-in networking capabilities including a unique HTTP URL and port forwarding. This page covers how to access your Sprites over the network.
9
+
Sprites run your code in the cloud. This page is about how to talk to that code via HTTPS URLs and port forwarding that make remote services feel local. You get a public endpoint to hit your app over the Internet, and the ability to proxy ports straight to your laptop so you can test, debug, and connect tools like you're running everything on localhost.
10
10
11
11
## Sprite URLs
12
12
13
-
Every Sprite has a unique URL for HTTP access:
13
+
Every Sprite has a unique URL for HTTPS access, for example:
14
14
15
15
```bash
16
16
sprite url
17
17
# Output: https://my-sprite-abc123.sprites.dev
18
18
```
19
19
20
-
This URL can be used to:
20
+
If your code is listening on a port (say, 3000 or 8080), that URL routes traffic to it. This means you can:
21
21
22
22
- Access web applications running in your Sprite
23
+
- Test a dev server in the cloud
23
24
- Make API requests to services
24
-
- Connect to any HTTP-based service
25
+
- Connect services to each other via HTTP
25
26
26
27
### URL Authentication
27
28
28
-
By default, Sprite URLs require authentication. You can configure this:
29
+
By default, Sprite URLs are private and they require a valid token. You can make them public if you want to share a demo, open up a webhook, or quickly put something onto the Internet:
29
30
30
31
<Tabs>
31
32
<TabItemlabel="CLI">
32
33
```bash
33
-
# Make URL public (no authentication required)
34
+
# Make URL public (no authentication required) - good for webhooks, public APIs, demos
34
35
sprite url update --auth public
35
36
36
-
# Require sprite authentication (default)
37
+
# Require sprite authentication (default) - good for internal services, development
37
38
sprite url update --auth default
38
39
```
39
40
</TabItem>
@@ -47,32 +48,15 @@ console.log(info.url);
47
48
</TabItem>
48
49
</Tabs>
49
50
50
-
| Auth Mode | Description | Use Case |
51
-
|-----------|-------------|----------|
52
-
|`sprite`| Requires Sprite token | Internal services, development |
53
-
|`public`| No authentication | Public APIs, webhooks, demos |
54
-
55
51
Updating URL settings is available via the CLI, Go SDK, or REST API (the JS SDK does not expose a helper yet).
56
52
57
-
### Starting a Web Server
58
-
59
-
Run a web server and access it via the Sprite URL:
# Access via browser or curl (after making public)
119
+
curl https://my-sprite-abc123.sprites.dev:8080/
200
120
```
201
121
202
-
## Common Patterns
203
-
204
122
### Development Server
205
123
124
+
Let's say you've got a frontend or backend dev server that watches files and hot reloads.
125
+
206
126
```bash
207
127
# Start dev server in detachable session
208
128
sprite exec -detachable "cd /home/sprite/app && npm run dev"
@@ -213,9 +133,12 @@ sprite proxy 3000
213
133
# Open in browser
214
134
open http://localhost:3000
215
135
```
136
+
If your server starts dynamically (e.g. via a watcher), Sprites can emit events when a process binds a port. You can hook into those if you want to script around startup behavior.
216
137
217
138
### Database Access
218
139
140
+
Running a database inside a Sprite is weirdly nice. You can spin up Postgres, forward its port, and connect with your usual tools:
-**Outbound**: All protocols and ports. You can fetch packages, call APIs and more
172
+
-**Inbound**: Only via Sprite URL or port forwarding
173
+
-**DNS**: Standard resolution works
261
174
262
-
The default environment includes common tools. Install additional ones as needed:
175
+
The default environment includes common network tools, and you can install additional ones as needed. You can run tools like `netcat`, `curl`, or `nmap` or `wget`. Nothing is artificially restricted and this isn't a locked-down environment.
1.**Only expose what you need** - Run services on specific ports
275
-
2.**Use application-level auth** - Implement your own authentication
276
-
3.**Monitor access** - Check logs for unexpected traffic
277
-
4.**Temporary exposure** - Make public only when needed
278
-
279
-
### Firewall Rules
280
-
281
-
Services inside your Sprite can bind to any port. Control access through:
282
-
283
-
- URL authentication settings
284
-
- Application-level security
285
-
- Not exposing sensitive services
286
-
287
182
## Troubleshooting
288
183
289
-
### Port Not Accessible
184
+
**Not seeing your app on the URL?** Make sure it's listening on `0.0.0.0`, not `localhost`. The router can't see loopback-only services.
290
185
291
-
```bash
292
-
# Check if service is running
293
-
sprite exec"ss -tlnp"
186
+
**Forwarded port not responding?** Check the app is actually running, and that you forwarded the right port. Use `sprite ps` to see running processes.
294
187
295
-
# Check if service is bound to correct interface
296
-
sprite exec"netstat -tlnp"
188
+
**Getting a 403 on your Sprite URL?** It's probably set to private. Make it public with `sprite url --public` or authenticate with a token.
297
189
298
-
# Services should bind to 0.0.0.0, not 127.0.0.1
299
-
```
190
+
**Dynamic apps not ready right away?** If your service binds ports after startup, you can use port open events from the SDK to wait for readiness.
191
+
192
+
## Security Notes
300
193
301
-
### Connection Refused
194
+
By default, your Sprite isn't publicly accessible. That's on purpose. You control what gets exposed — either by forwarding a port or making the Sprite's URL public.
302
195
303
-
1. Verify the service is running
304
-
2. Check the port number
305
-
3. Ensure service binds to `0.0.0.0` not just `localhost`
306
-
4. Verify port forwarding is active
196
+
A few things to keep in mind:
307
197
308
-
### Slow Connections
198
+
-**Only expose what you actually need** - Run services on specific ports
199
+
-**Use app-level auth** - If you're building anything real, implement your own authentication
200
+
-**Forwarded ports are reachable from your machine** — Not the wider Internet.
201
+
-**Temporary exposure** - Make public only when needed.
309
202
310
-
- Check if Sprite is hibernated (first request wakes it)
311
-
- Consider pre-warming for latency-sensitive applications
312
-
- Use regions closer to your users
203
+
We don't add firewall rules or block inbound traffic to forwarded ports, but we also don't auto-protect what you expose. You're in control, which is powerful — and dangerous, if you're not paying attention. Keep it minimal and secure.
313
204
314
205
## Related Documentation
315
206
316
-
-[Sprites Guide](/sprites) - Comprehensive guide
317
-
-[CLI Commands](/cli/commands) - Port forwarding commands
0 commit comments