EasyTunnel is a simple and efficient tunneling system that exposes your localhost services to the internet via a domain name. It consists of two components: a Tunnel Client that runs on your local machine and a Tunnel Server that runs on your domain.
- Expose localhost services to the internet
- Secure WebSocket communication
- JWT authentication
- Automatic reconnection
- Health monitoring
- TypeScript support
- Environment-based configuration
- Node.js (v14 or higher)
- npm or yarn
- A domain name and a nodejs hosting for the tunnel server
- SSL certificate (for HTTPS support)
- Navigate to the server directory:
cd server
- Install dependencies:
npm install
- Create environment configuration:
cp .env.example .env
- Edit the
.env
file with your configuration:
- Set your JWT secret
- Set allowed origins
- Build and start the server:
npm run build
npm start
- Navigate to the client directory:
cd client
- Install dependencies:
npm install
- Edit the
index.ts
file with your configuration:
- Set your tunnel server URL
- Configure your JWT token
- Set your local service port
- Build and start the client:
npm start
-
Start your local service (e.g., a web server on port 8080)
-
Start the tunnel server on your domain
-
Start the tunnel client on your local machine
-
Your local service is now accessible through your domain!
PORT
: Server port (default: 3000)HOST
: Server host (default: 0.0.0.0)JWT_SECRET
: Secret key for JWT authenticationALLOWED_ORIGINS
: Comma-separated list of allowed origins for CORS
TUNNEL_SERVER_URL
: URL of your tunnel serverAUTH_TOKEN
: JWT authentication tokenLOCAL_PORT
: Port of your local serviceLOCAL_HOST
: Host of your local serviceHEARTBEAT_INTERVAL
: Interval for health checksREQUEST_TIMEOUT
: Timeout for local service requestsRECONNECT_INTERVAL
: Interval for reconnection attempts
- Always use HTTPS in production
- Keep your JWT token secure
- Configure CORS settings appropriately
- Regularly update dependencies
- Monitor server logs for suspicious activity
MIT