Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>pocket-previewNew to Visual Studio Code? Get it now.
pocket-preview

pocket-preview

samarpan

|
1 install
| (0) | Free
a live preview setup for quick access oven any network or phone
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

📱 Pocket Preview

VSCode Marketplace License GitHub

Preview your local dev server instantly on any device with a QR code.


🎬 Demo

Live Preview on Phone

Live Preview GIF

Automatic Live Reload

Auto Refresh GIF


✨ Features

  • 🌐 Public live preview of your local project
  • 📱 QR code for instant mobile access
  • 🔄 Automatic live reload on file changes
  • ⚡ Supports React, Vite, and plain HTML
  • 🚀 One-command start
  • ⚙️ Automatically detects dev server port
  • 🟢 Checks for CloudFlred installation and guide users

📦 Installation

1. From VS Code Marketplace

Search Pocket Preview → click Install

2. Manual Install

code --install-extension pocket-preview-0.0.6.vsix

⚙️ Requirements

  • Node.js installed
  • Dev server running (npm run dev)
  • Cloudflare Tunnel (cloudflared) installed & in PATH

if CloudFlared is not found ,the extention will prompt you to download it : download cloudflared

Tunnel generates a public URL for your preview.


🛠 Setup for Vite Projects

To avoid blocked requests, add this to vite.config.js:

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

export default defineConfig({
  plugins: [react()],
  server: {
    host: true,
    cors: true,
    allowedHosts: ['.trycloudflare.com'],
    hmr: {
      protocol: 'wss',
      host: '.trycloudflare.com',
      clientPort: 443
    }
  }
})

Restart your dev server after updating.


▶️ How to Use

  1. Start your project:
npm run dev
  1. Open VS Code Command Palette:
  • Windows/Linux: Ctrl + Shift + P
  • Mac: Cmd + Shift + P
  1. Run:
Preview on Phone
  1. Scan the displayed QR code — your live preview opens instantly.

  2. Edit files — changes auto-refresh on phone.


⚠️ Troubleshooting

QR not showing / No public URL

  • Ensure cloudflared is installed and PATH is correct
  • Dev server must be running

Blocked request error

  • Check allowedHosts in vite.config.js
  • Restart server after changes

Cloudflared not detected

  • install from cloudflared downloads

📌 Notes

  • URL changes each preview session
  • Works best with Vite or React
  • Live reload is automatic

🚧 Planned Improvements

  • Auto-install Cloudflare Tunnel
  • Auto-detect and patch Vite config
  • Better device tracking UI

👨‍💻 Author / Credit

Built by Sam (owsam22)

  • GitHub: owsam22
  • LinkedIn: samarpan22

📜 License

MIT License — see LICENSE

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft