Multi-Port Tunneling

Expose multiple services on a single hostname with HTTP and TCP on different ports

Overview

Multi-port tunneling allows you to expose multiple services (HTTP, TCP, databases, APIs) under a single tunnel hostname. This is perfect for full-stack applications where you need to expose both your web frontend and backend services like databases.

✨ Key Benefits:
  • One tunnel ID for multiple services
  • HTTP on standard ports (80/443) + TCP on custom ports
  • Perfect for full-stack development
  • All traffic under one hostname

Quick Start

Basic Multi-Port Tunnel (HTTP + PostgreSQL)

# Start your services locally
npm run dev              # HTTP server on port 3000
docker run -p 5432:5432 postgres  # PostgreSQL on port 5432

# Create multi-port tunnel
simpletunnel -port 3000 -tcp 5432

✓ Tunnel established!
Tunnel ID: nova-4823

HTTP Service:
  Local:     localhost:3000
  Public:    https://nova-4823.simpletunnel.com

TCP Service (PostgreSQL):
  Local:     localhost:5432
  Public:    nova-4823.simpletunnel.com:15432

📝 Logs: /Users/you/.simpletunnel/logs/nova-4823.log

Multiple TCP Ports

You can expose multiple TCP services by specifying the -tcp flag multiple times:

HTTP + PostgreSQL + Redis

# Start your services
npm run dev              # Port 3000
docker run -p 5432:5432 postgres
docker run -p 6379:6379 redis

# Create tunnel with multiple TCP ports
simpletunnel -port 3000 -tcp 5432 -tcp 6379

✓ Tunnel established!
Tunnel ID: aurora-7621

HTTP Service:
  Local:     localhost:3000
  Public:    https://aurora-7621.simpletunnel.com

TCP Service (PostgreSQL):
  Local:     localhost:5432
  Public:    aurora-7621.simpletunnel.com:15432

TCP Service (Redis):
  Local:     localhost:6379
  Public:    aurora-7621.simpletunnel.com:16379

Real-World Example: Full-Stack App

Next.js + PostgreSQL + Redis

# 1. Start all services locally
npm run dev                          # Next.js on 3000
docker compose up postgres redis     # DB on 5432, Redis on 6379

# 2. Create multi-port tunnel
simpletunnel -port 3000 -tcp 5432 -tcp 6379

# 3. Update your .env to use public endpoints
DATABASE_URL="postgresql://user:pass@aurora-7621.simpletunnel.com:15432/mydb"
REDIS_URL="redis://aurora-7621.simpletunnel.com:16379"

# 4. Share with your team
Frontend: https://aurora-7621.simpletunnel.com
Database: aurora-7621.simpletunnel.com:15432
Cache:    aurora-7621.simpletunnel.com:16379

Connection Examples

PostgreSQL

# Using psql
psql -h nova-4823.simpletunnel.com -p 15432 -U myuser -d mydb

# Connection string
postgresql://myuser:mypass@nova-4823.simpletunnel.com:15432/mydb

# In your app (Node.js)
const { Pool } = require('pg');
const pool = new Pool({
  host: 'nova-4823.simpletunnel.com',
  port: 15432,
  user: 'myuser',
  password: 'mypass',
  database: 'mydb'
});

MySQL

# Using mysql client
mysql -h nova-4823.simpletunnel.com -P 13306 -u root -p

# Connection string
mysql://root:password@nova-4823.simpletunnel.com:13306/mydb

Redis

# Using redis-cli
redis-cli -h nova-4823.simpletunnel.com -p 16379

# Connection string
redis://nova-4823.simpletunnel.com:16379

MongoDB

# Connection string
mongodb://nova-4823.simpletunnel.com:27017/mydb

Use Cases

1. Full-Stack Development

Share your entire application stack (frontend + backend + database) with one URL.

2. Database Access for Remote Teams

Let remote developers connect to your local database for debugging without VPN.

3. Microservices Testing

Expose multiple microservices on different TCP ports for integration testing.

4. Demo Applications

Show clients a complete working application with real data and database connections.

💡 Pro Tip: Use multi-port tunneling with password protection to secure all your exposed services:
simpletunnel -port 3000 -tcp 5432 -password mySecret123

Limitations & Notes

  • Free tier: HTTP tunneling only (no TCP)
  • Pro tier: Up to 5 concurrent tunnels with TCP support
  • Business tier: Unlimited tunnels and reserved TCP ports
  • Port allocation: TCP ports are automatically assigned (you can't choose specific port numbers on shared plans)

Next Steps