you shouldn't have to mess with vnc, rdp or ssh to view your laptop's screen on your computer (or any other device on your network).
run nanoshare using bun:
bunx nanosharemacos will ask for permission to access your screen, and you might have to restart your terminal before the permission is granted by the os.
this will obviously require bun.
- bun installed
ffmpeginstalled and available in yourPATH- host and viewer on the same network
- screen-recording permission granted to terminal (macos)
nanoshare runs on port 37777 by default, at 30fps with 14M video bitrate. you can change settings by passing flags when running bunx nanoshare.
--port <number>– change the port to listen on--fps <number>– change the framerate--video-bitrate <bitrate>– change the video bitrate--use-hwaccel– enable hardware acceleration on macOS--source <screen|testsrc>– use a test pattern or screen capture--rtp-port <number>– change the local port for ffmpeg → webrtc ingress--pin <pin>– change the pin to require to access the live stream
default:
bunx nanosharecustom port + pin:
bunx nanoshare --port 3000 --pin 123456use a test source (great for debugging without sharing your actual screen):
bunx nanoshare --source testsrcmacos hardware encoding:
bunx nanoshare --use-hwaccelif you prefer env vars over cli flags:
NANOSHARE_PORT(default:37777)NANOSHARE_PIN(default: random 6-digit pin)NANOSHARE_FPS(default:30)NANOSHARE_VIDEO_BITRATE(default:14M)NANOSHARE_USE_HWACCEL=1to enable hw acceleration on macosNANOSHARE_SOURCE=screen|testsrc(default:screen)NANOSHARE_RTP_PORT(default:5004)NANOSHARE_DISPLAY(linux only, optional override for X11 display)
example:
NANOSHARE_PORT=3000 NANOSHARE_FPS=60 NANOSHARE_VIDEO_BITRATE=8M bunx nanosharewhen nanoshare starts, it prints:
- local url (for same machine)
- lan url (for other devices on your network)
- a 6-digit pin
open the url on another device, enter the pin once, and you're in.
ffmpeg: command not found
install ffmpeg first (brew install ffmpeg,sudo apt install ffmpeg, etc). on windows, have it in yourPATH.- macos keeps denying capture
enable your terminal in system settings → privacy & security → screen recording, then fully restart your terminal. - viewer can't connect
make sure both devices are on the same lan and your firewall allows the selected port. if the port is in use, try passing a different one with--port <number>. - linux black screen
check thatNANOSHARE_DISPLAY(or systemDISPLAY) is set correctly (for example:0.0).
built by exotic with gpt-5.3-codex in a couple hours. feel free to contribute if you want, or fork and improve.