Skip to content

extoci/nanoshare

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nanoshare – local screen sharing, as simple as it gets

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).

usage

run nanoshare using bun:

bunx nanoshare

macos 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.

requirements

  • bun installed
  • ffmpeg installed and available in your PATH
  • host and viewer on the same network
  • screen-recording permission granted to terminal (macos)

features

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

quick examples

default:

bunx nanoshare

custom port + pin:

bunx nanoshare --port 3000 --pin 123456

use a test source (great for debugging without sharing your actual screen):

bunx nanoshare --source testsrc

macos hardware encoding:

bunx nanoshare --use-hwaccel

environment variables

if 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=1 to enable hw acceleration on macos
  • NANOSHARE_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 nanoshare

what you'll see

when 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.

troubleshooting

  • ffmpeg: command not found
    install ffmpeg first (brew install ffmpeg, sudo apt install ffmpeg, etc). on windows, have it in your PATH.
  • 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 that NANOSHARE_DISPLAY (or system DISPLAY) is set correctly (for example :0.0).

acknowledgements

built by exotic with gpt-5.3-codex in a couple hours. feel free to contribute if you want, or fork and improve.

About

local screen sharing, as simple as it gets

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors