http-party / http-server

a simple zero-configuration command-line http server
MIT License
13.42k stars 1.48k forks source link

Server still runs, even after computer restart - blocks port #840

Closed mikeburns closed 1 year ago

mikeburns commented 1 year ago

Server continues to run after hard re-boot/PC crash (no CTRL+C) and cannot be stopped

Environment Versions

  1. Windows 10
  2. Node version: 16.14.0
  3. http-server version: 14.1.1 (installed via npx)

Steps to reproduce

  1. npx http-server
  2. force-shutdown the computer
  3. restart computer
  4. open http://localhost:80

Expected result

ERR_CONNECTION_REFUSED

Actual result

it continues serving the files

Other information

I even tried remove the entire _npx cache folder and removing the folder from where I originally called npx http-server and it STILL runs the code! Even after multiple hard reboots. I thought a hard reboot would clear all memory, so maybe it's "living" somewhere else? Or maybe Win10 doesn't clear all memory on reboot?

mikeburns commented 1 year ago

UPDATE: the original codebase I was running was an SPA that used offline caching, so it turns out the entire site was running in the browser cache and not being serverd via http-server.

Hopefully this helps anyone else pulling out their hair and questioning their knowledge of how webservers work...