Skip to content

zhoudaqing/stop-server

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stop-server

Shut down ⚡ your computer using Node.js and a phone (works on OS X, Linux and Windows)

Created because I usually watch movies on my computer from my bed and I wanted to be able to shut it down remotely :)

Usage

  1. Install stop-server
npm install -g stop-server
stop-server start # Need to be done only once
  1. Visit http://localhost:5709/qr.html on your computer and scan the QR code or go directly to http://your-local-ip:5709 on your phone. You should see this page:

  1. That's all :)

Important depending on your OS, you need to allow commands to be used without sudo:

# Run 'sudo visudo' and add
your-username ALL=NOPASSWD: /sbin/shutdown       # OS X and Linux
your-username ALL=NOPASSWD: /usr/sbin/pm-suspend # Linux only

Uninstall

npm rm -g stop-server

How it works?

stop-server is a simple Express server with a few routes:

POST http://your-local-ip:5709/power-off
POST http://your-local-ip:5709/sleep

It's also automatically started on log in using user-startup.

License

MIT - typicode

About

Shut down your computer using nodejs and a phone

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 47.5%
  • HTML 45.3%
  • CSS 7.2%