Local Tunnel Service

Онлайн

Туннелирование локальных приложений через HTTPS без проброса портов

HTTPS/WSS
Мгновенно
Любые порты
Dev-режим

Быстрый запуск

1. Создайте клиент

npm init -y && npm install ws

2. Создайте client.js

const WebSocket = require('ws');
const http = require('http');

const subdomain = process.argv[2] || 'test';
const port = process.argv[3] || 3000;

const ws = new WebSocket('wss://local.wddt.ru:3000');

ws.on('open', () => {
  ws.send(JSON.stringify({ type: 'register', subdomain }));
  console.log(`Туннель: https://${subdomain}.local.wddt.ru -> localhost:${port}`);
});

ws.on('message', (data) => {
  const msg = JSON.parse(data);
  if (msg.type === 'request') {
    const options = {
      hostname: 'localhost',
      port: port,
      path: msg.url,
      method: msg.method,
      headers: msg.headers
    };
    
    const req = http.request(options, (res) => {
      let body = Buffer.alloc(0);
      res.on('data', chunk => body = Buffer.concat([body, chunk]));
      res.on('end', () => {
        ws.send(JSON.stringify({
          type: 'response',
          requestId: msg.requestId,
          status: res.statusCode,
          headers: res.headers,
          body: body.toString('base64')
        }));
      });
    });
    
    req.on('error', () => {
      ws.send(JSON.stringify({
        type: 'response',
        requestId: msg.requestId,
        status: 502,
        body: Buffer.from('Service unavailable').toString('base64')
      }));
    });
    
    if (msg.body) req.write(Buffer.from(msg.body, 'base64'));
    req.end();
  }
});

3. Запустите туннель

node client.js myapp 3000

Ваше приложение станет доступно: https://myapp.local.wddt.ru

Примеры запуска

React Dev Server

node client.js react 5173

→ https://react.local.wddt.ru

Express API

node client.js api 3001

→ https://api.local.wddt.ru

Static Files

node client.js static 8080

→ https://static.local.wddt.ru

Python App

node client.js python 5000

→ https://python.local.wddt.ru

Дополнительные возможности

Запуск в фоне

nohup node client.js myapp 3000 > tunnel.log 2>&1 &

Множественные туннели

node client.js frontend 3000 &
node client.js backend 3001 &
node client.js admin 3002 &

Остановка туннелей

pkill -f "node client.js"

Как это работает

1. Локальное приложение

Ваше приложение работает на localhost:порт

2. WebSocket туннель

Клиент подключается к серверу и проксирует запросы

3. Публичный доступ

Приложение доступно через HTTPS поддомен