{"id":35156004,"url":"https://github.com/antash-mishra/open-tunnel","last_synced_at":"2026-05-21T19:35:16.157Z","repository":{"id":288759908,"uuid":"969102537","full_name":"antash-mishra/open-tunnel","owner":"antash-mishra","description":"WebSocket tunneling server and client to expose local web servers.","archived":false,"fork":false,"pushed_at":"2025-04-19T16:51:02.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-31T03:32:37.043Z","etag":null,"topics":["http","javascript","ngrok-replacement","typescript","websocket"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/antash-mishra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-19T11:47:10.000Z","updated_at":"2025-04-19T19:38:33.000Z","dependencies_parsed_at":"2025-04-19T17:07:43.885Z","dependency_job_id":"acd375da-0560-42bb-9b8e-d5c5105d3b20","html_url":"https://github.com/antash-mishra/open-tunnel","commit_stats":null,"previous_names":["antash-mishra/open-tunnel"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/antash-mishra/open-tunnel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antash-mishra%2Fopen-tunnel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antash-mishra%2Fopen-tunnel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antash-mishra%2Fopen-tunnel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antash-mishra%2Fopen-tunnel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antash-mishra","download_url":"https://codeload.github.com/antash-mishra/open-tunnel/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antash-mishra%2Fopen-tunnel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33311875,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-21T12:23:38.849Z","status":"ssl_error","status_checked_at":"2026-05-21T12:22:11.673Z","response_time":62,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["http","javascript","ngrok-replacement","typescript","websocket"],"created_at":"2025-12-28T17:00:04.550Z","updated_at":"2026-05-21T19:35:16.137Z","avatar_url":"https://github.com/antash-mishra.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Open Tunnel: WebSocket Tunneling Server \u0026 Client\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![NPM Client Package](https://img.shields.io/npm/v/@antash-mishra/tunnel-client.svg)](https://www.npmjs.com/package/@antash-mishra/tunnel-client)\n\nThis project provides a simple implementation of a WebSocket-based tunneling service, similar in concept to tools like ngrok or Cloudflare Tunnel, allowing you to expose a local web server to the internet.\n\nIt consists of two main parts:\n\n1.  **Tunnel Server (`./src`)**: A Node.js server built with Express and WebSockets (`ws`) that accepts connections from tunnel clients and routes public HTTP requests to the appropriate client.\n2.  **Tunnel Client (`./client`)**: A command-line tool (publishable as an NPM package) that connects to the tunnel server and proxies incoming tunnel requests to a specified local server.\n\n## Features\n\n*   **Expose Local Servers**: Make your local development servers (HTTP/HTTPS) accessible via a public URL.\n*   **WebSocket Communication**: Uses WebSockets for persistent connection between client and server.\n*   **Simple Protocol**: Custom JSON-based protocol for tunneling requests and responses.\n*   **Dynamic Tunnel IDs**: Server assigns unique IDs to connected clients.\n*   **Command-Line Client**: Easy-to-use CLI tool for initiating tunnels.\n*   **Deployable Server**: Includes Dockerfile and Fly.io configuration for easy deployment.\n\n## Project Structure\n\n```\nopen-tunnel/\n├── src/                # Tunnel Server source code (TypeScript)\n│   └── index.ts\n├── client/             # Tunnel Client source code (JavaScript)\n│   ├── tunnel-client.js  # Client executable\n│   ├── package.json      # Client package manifest\n│   ├── README.md         # Client-specific README\n│   └── ...\n├── Dockerfile          # Dockerfile for deploying the server\n├── fly.toml            # Fly.io deployment configuration\n├── package.json        # Server package manifest\n├── tsconfig.json       # TypeScript configuration for the server\n└── README.md           # This file (Project overview)\n```\n\n## Server Setup \u0026 Usage\n\nThe server listens for WebSocket connections from clients and handles incoming HTTP requests for established tunnels.\n\n**Prerequisites:**\n\n*   Node.js (Version specified in `Dockerfile`, e.g., v22)\n*   npm\n\n**Installation:**\n\n```bash\n# Clone the repository (if you haven't already)\ngit clone https://github.com/antash-mishra/open-tunnel.git\ncd open-tunnel\n\n# Install server dependencies\nnpm install\n```\n\n**Running Locally (Development):**\n\n```bash\n# Build TypeScript and start with nodemon for auto-reloading\nnpm run dev\n```\n\nThis compiles the TypeScript code and uses `nodemon` to watch for changes in the `src` directory. The server will typically start on port 8080 (or the port specified by the `PORT` environment variable).\n\n**Running Locally (Production Mode):**\n\n```bash\n# 1. Build the TypeScript code\nnpm run build\n\n# 2. Start the server\nnpm start\n```\n\nThis runs the compiled JavaScript code from the `build` directory.\n\n**Deployment:**\n\nThis project includes a `Dockerfile` and `fly.toml` configured for deployment on [Fly.io](https://fly.io/).\n\n1.  **Install Fly CLI**: Follow instructions at [fly.io/docs/hands-on/install-flyctl/](https://fly.io/docs/hands-on/install-flyctl/)\n2.  **Login**: `fly auth login`\n3.  **Launch (first time)**: `fly launch` (Review and adjust settings if needed)\n4.  **Deploy**: `fly deploy`\n\nYour server will be deployed and accessible at `https://\u003cyour-app-name\u003e.fly.dev`. The WebSocket endpoint will be `wss://\u003cyour-app-name\u003e.fly.dev`.\n\n## Client Setup \u0026 Usage\n\nThe client is a command-line tool used to connect your local server to the running tunnel server.\n\n**Installation:**\n\nThe client is published as an NPM package. Install it globally:\n\n```bash\nnpm install -g @antash-mishra/tunnel-client\n```\n\n**Link:** [npmjs.com/package/@antash-mishra/tunnel-client](https://www.npmjs.com/package/@antash-mishra/tunnel-client?activeTab=readme)\n\n**Usage:**\n\n```bash\ntunnel-client \u003clocal-server-url\u003e [options]\n```\n\n*   **`\u003clocal-server-url\u003e`**: (Required) The URL of your local server (e.g., `http://localhost:3000`).\n*   **`[options]`**: `-s` or `--server-url` to specify the WebSocket URL of the tunnel server (defaults to `ws://localhost:8080`).\n\n**Examples:**\n\n```bash\n# Connect local http://localhost:5000 to a local tunnel server (ws://localhost:8080)\ntunnel-client http://localhost:5000\n\n# Connect local http://127.0.0.1:8000 to a deployed tunnel server\ntunnel-client http://127.0.0.1:8000 -s wss://your-tunnel-app.fly.dev\n```\n\nFor more details, see the client's README: [`client/README.md`](./client/README.md)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantash-mishra%2Fopen-tunnel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantash-mishra%2Fopen-tunnel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantash-mishra%2Fopen-tunnel/lists"}