Skip to content

wanderer-npm/localhost-map

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

localhost-map

vs code sidebar that shows every dev server currently listening on your machine, across every workspace, with the process behind each port and a one-click open/kill/copy.

why

on a normal day i have:

  • next on 3000
  • some api on 8080
  • postgres on 5432
  • redis on 6379
  • another project still running from yesterday on 5173
  • something on 4000 that i don't remember starting

the built-in "ports" panel in vs code only shows what the current workspace is forwarding. docker desktop shows containers, not dev servers. nothing shows the whole picture at once. localhost-map is that view.

how it works

  • linux: reads /proc/net/tcp and /proc/*/fd/* to map listening sockets back to pids without shelling out.
  • macos: lsof -iTCP -sTCP:LISTEN.
  • windows: netstat -ano plus tasklist for process names.
  • when the process is owned by another user (docker-proxy, system postgres, etc.), it falls back to docker ps to at least show the container name.

this means root-owned processes usually show as docker: <container> rather than "unknown". there's no good way to get their actual pid without running vs code as root, and i'd rather not do that.

using it

install the vsix:

code --install-extension localhost-map-0.1.0.vsix

click the globe icon in the activity bar. the panel auto-refreshes every 4 seconds. click a row to open http://localhost:<port>. inline buttons let you copy the url or kill the pid.

settings

  • localhostMap.refreshIntervalMs (default 4000): set 0 to disable auto-refresh.
  • localhostMap.minPort (default 1024): hide privileged ports.
  • localhostMap.maxPort (default 65535).
  • localhostMap.ignoreProcesses (default: chrome, firefox, code, cursor, slack, spotify): substring match on command name.

build from source

git clone https://github.com/wanderer-npm/localhost-map
cd localhost-map
npm install
npm run compile
npx vsce package

caveats

  • killing a process kills it cleanly with sigterm, then sigkill 1.5s later if it's still alive. it will not warn you twice.
  • the docker enrichment only runs if the docker cli is on your path. without docker it just shows blank process info for root-owned services.
  • windows testing has been light so far. works with docker desktop. file an issue if netstat output is weird on your setup.

license

mit.

About

vs code sidebar that shows every dev server listening on your machine with the process behind each port

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors