Skip to content

Studio Recipes: Networking

Use these recipes to control Turbo Studio container egress with IP routing and reusable route files.

What You'll Learn

  • How to build single-site browsers with IP allowlists
  • How to reroute blocked domains to internal hosts
  • How to reuse routing rules across images with layers or route files

Networking Recipes

Create a Single-Site Browser

Build a browser container that blocks all IP traffic except the domains you allow. Replace the domain patterns with your target site.

bash
turbo new firefox --route-block=ip --route-add=ip://*.example.com --route-add=ip://*.examplecdn.com

Validate:

  • Browse to the allowed domains and confirm pages load.
  • Attempt to access an unrelated domain and verify the request is blocked.
  • Run turbo netstat to confirm only the allowed routes are active.

Reroute a Blocked Domain to an Internal Host

Send traffic for a public domain to a service running on 127.0.0.1. Use this when you want a captive experience for a specific site.

bash
turbo new firefox --route-add=ip://*.blockedsite.com:127.0.0.1

Validate:

  • Start a local web server on port 80 and confirm requests to blockedsite.com reach it.
  • Check that other domains continue to resolve normally.

Save Routing Rules as a Reusable Layer

Package routing rules into a layer so you can apply the same policy to multiple images.

bash
turbo new --name=network-blocking-container --route-block=ip --route-add=ip://turbo.net --route-add=ip://192.168.1.0/24 --route-add=ip://127.0.0.1
turbo commit network-blocking-container network-blocking-layer
turbo new network-blocking-layer,chrome https://turbo.net

Validate:

  • Confirm network-blocking-layer appears in turbo images.
  • Launch another image with the layer and verify the routing rules apply without retyping them.

Apply a Route File for Large Allowlists

Store long allowlists or blocklists in a route file instead of repeating flags.

text
[ip-block]
*
[ip-add]
*.turbo.net
*.spoon.net

Apply the file during build or run:

bash
turbo try firefox --route-file=routes.txt --name=turbo-firefox

Validate:

  • Confirm the route file is referenced in the command output.
  • Attempt to reach allowed and blocked domains to verify the file rules are honored.