Settings

Theme

Show HN: Portname – named localhost URLs for every dev server

github.com

4 points by hrncode a month ago · 4 comments · 1 min read

Reader

Tired of localhost:3000 clashing with other projects. Built portname — a local proxy that gives every dev server a named URL instead of a port.

portname run dev → myapp.localhost:1999

Auto-detects Vite/Next/Nuxt, patches config automatically, proxies WebSocket so HMR works. Single binary, no dependencies.

https://github.com/hirendhola/portname

CoderNextDoor a month ago

This looks really clean, thanks for sharing! Does it work with custom domains too, or is it localhost only? I've got a project that needs to test against a specific domain locally.

  • hrncodeOP a month ago

    localhost only for now — portname works with *.localhost subdomains which browsers resolve automatically so no config needed.

    for custom domains like myapp.company.com you'd need to manually add it to your hosts file (/etc/hosts on Mac/Linux, C:\Windows\System32\drivers\etc\hosts on Windows) pointing to 127.0.0.1.

    custom domain support is something i'd like to add in future

ebhn a month ago

This is super useful. Thanks for sharing!

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection