.do
Development

tunnels

Tunnel and networking services

tunnels

Secure tunneling for exposing local services to the internet, testing webhooks, and connecting private networks with automatic HTTPS and custom domains.

Overview

The tunnels primitive provides secure tunneling similar to ngrok, enabling local development to receive webhooks, test integrations, and expose services without complex networking configuration.

Quick Example

import { tunnels } from 'sdk.do'

// Create tunnel
const tunnel = await tunnels.create({
  port: 3000,
  subdomain: 'my-app',
  auth: {
    type: 'basic',
    username: 'admin',
    password: 'secret',
  },
})

console.log(`Tunnel URL: ${tunnel.url}`)
// https://my-app.tunnel.do

// Monitor tunnel traffic
tunnel.on('request', (req) => {
  console.log(`${req.method} ${req.path}`)
})

// Close tunnel
await tunnel.close()

Core Capabilities

  • Local Exposure - Expose local services to the internet
  • HTTPS Automatic - Free SSL/TLS certificates
  • Custom Domains - Use your own domain names
  • Traffic Inspection - Monitor and log all requests
  • Authentication - Protect tunnels with basic auth or tokens

Access Methods

SDK

TypeScript/JavaScript library for tunnel management

await tunnels.create({ port: 3000, subdomain: 'my-app' })

SDK Documentation

CLI

Command-line tool for tunnel operations

do tunnel create --port 3000 --subdomain my-app

CLI Documentation

API

REST/RPC endpoints for tunnel management

curl -X POST https://api.do/v1/tunnels -d '{"port":3000,"subdomain":"my-app"}'

API Documentation

MCP

Model Context Protocol for AI-driven tunnel creation

Create a tunnel for port 3000 with subdomain "my-app"

MCP Documentation