Auth-Protected Apps

Access any localhost port through Clawdy's secure subdomain proxy without configuring nginx or reverse proxies.

3 min read

One of Clawdy's most powerful features is the ability to access any application running on your instance through a secure, authenticated subdomain. No nginx configuration, no SSL setup, no firewall rules.

How It Works

When you run a web application on your OpenClaw instance (like a Next.js dev server on port 3000), you can access it through a special subdomain pattern:

https://{port}--{your-slug}.clawdy.app

For example, if your instance slug is dev-machine and you're running an app on port 3000:

https://3000--dev-machine.clawdy.app

Key Benefits

Automatic Authentication

Every request to your app goes through Clawdy's authentication layer. Only you (and people you explicitly share access with) can access your running applications. No need to:

  • Set up HTTP basic auth
  • Configure OAuth
  • Manage API keys
  • Worry about exposing development servers

Automatic SSL

All connections are encrypted with SSL/TLS. You get HTTPS for free on any port, any application. This is especially useful for:

  • Testing OAuth callbacks that require HTTPS
  • Developing Progressive Web Apps (PWAs)
  • Working with secure cookies
  • Testing WebSocket connections over WSS

Zero Configuration

There's nothing to configure. The moment you start a server on any port between 1024 and 65535, it's automatically accessible. Compare this to traditional setups:

Traditional SetupClawdy
Configure nginx reverse proxyNothing
Set up SSL with Let's EncryptNothing
Configure firewall rulesNothing
Set up authenticationNothing
Update DNS recordsNothing

Supported Ports

You can access any port in the range 1024-65535. Common examples:

PortTypical Use
3000Next.js, Create React App, Vite
3001Secondary dev server
4000GraphQL servers
5000Flask, generic backends
5173Vite default
8000Django, FastAPI
8080Various web servers
8888Jupyter notebooks

Example: Running a Next.js App

  1. SSH into your instance or use the web terminal
  2. Create and start your app:
npx create-next-app@latest my-app
cd my-app
npm run dev
  1. Access it instantly at https://3000--your-slug.clawdy.app

That's it. No additional configuration needed.

Pro Tips

Avoid Port Conflicts with path-to-port

When working on multiple projects, port conflicts are a common headache. Two projects both wanting port 3000? Use path-to-port to generate a unique port based on your project's path:

# Get a unique port for the current directory
bunx path-to-port `pwd`
# Output: 4821 (deterministic based on path)

Tell OpenClaw to use this pattern when building apps:

"When starting dev servers, use bunx path-to-port \pwd`` to set a unique port for this project so I don't have port conflicts with other projects."

This way, each project gets a consistent, unique port:

Project PathGenerated Port
~/projects/frontend4821
~/projects/backend5234
~/projects/admin-dashboard3892

You can then access each at its unique port: https://4821--your-slug.clawdy.app

Run Dev Servers in tmux Sessions

Don't tie up your terminal with a running dev server. Use tmux to run servers in the background:

# Create a named session for your project
tmux new -s my-app

# Start your dev server
npm run dev

# Detach (Ctrl+b, then d) - server keeps running!

# Later, reattach to check logs
tmux attach -t my-app

This is especially useful when you have multiple services running (frontend, backend, database). See the Web Terminal guide for more tmux tips.

Example: Sharing Your Work

Need to show your work to a colleague or client? They just need to:

  1. Have a Clawdy account
  2. Be added to your instance's access list (coming soon)

They can then view your running application at the same URL, fully authenticated.

WebSocket Support

The proxy fully supports WebSocket connections. If your application uses WebSockets (for real-time features, hot module replacement, etc.), they work automatically:

// This just works through the proxy
const ws = new WebSocket('wss://3000--your-slug.clawdy.app/ws');

Technical Details

Under the hood, Clawdy uses a Cloudflare Worker to:

  1. Intercept requests to {port}--{slug}.clawdy.app
  2. Validate the user's session
  3. Forward the request to your instance on the specified port
  4. Stream the response back to the user

The proxy handles:

  • HTTP/1.1 and HTTP/2
  • WebSocket upgrades
  • Server-Sent Events (SSE)
  • Large file uploads and downloads
  • Streaming responses

Limitations

  • Port range: Only ports 1024-65535 are supported (no privileged ports)
  • Local only: The application must be listening on localhost or 0.0.0.0
  • One instance: Each subdomain maps to one specific instance

Next Steps