frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Show HN: Port Zero – how I learned to stop worrying and love PORT=0

https://portzero.net/
6•octopoc•1h ago
Hi HN,

Recently I wasted several hours wrangling my dev environment only to find out that the browser frontend was talking to the wrong version of the backend. This got me thinking--why on earth are we still using simple numbers to describe which process to connect to? Why not use names instead? I thought of all the times a program wouldn't start because of port conflicts. The more I thought about it, the crazier it seemed.

Modern operating systems already offer no-conflict ports: if you make your TCP server listen on port 0, the OS assigns you a random available port. But that only solves half the problem.

I built the other half: PortZero. It's a GPLv3 program that watches for processes (and docker containers!) with a special PZ_TUNNEL environment variable:

  PZ_TUNNEL=myapp-{branch}.portzero.local:80 npm run dev
When it sees such a process or container, PortZero does this:

1. Create a virtual NIC (if it hasn't already)

2. Create a new virtual IP address

3. Create a DNS record that substitutes things like {branch} based on the working directory of the process, and points at that virtual IP address

4. Start listening on that virtual IP address on the port of your choice (e.g. port 80 for http, port 443 for https, port 5432 for postgresql)

5. Forward any TCP connections to that virtual IP address / virtual port to the random, OS-assigned port that your process or container is actually listening on

The result is you don't have to think about ports anymore, you just have to think about subdomains. You can have multiple services available on port 80 without conflicts, as long as they have different portzero.local subdomains.

It does some other cool stuff like:

- Enable HTTPS on local HTTP services by creating a local CA and registering it on your machine

- Enable cloud tunnels so you can access your apps on other devices (paid feature)

Links:

https://portzero.net/docs/

https://github.com/PortZeroNetwork/portzero

Comments

ignoramous•32m ago
> why on earth are we still using simple numbers to describe which process to connect to? Why not use names instead.

Not super popular, but: https://en.wikipedia.org/wiki/SRV_record

yjftsjthsd-h•23m ago
Yep, my immediate reaction was "because browsers refuse to support SRV records" (although I think there was some new variant that kinda worked?)

Show HN: Physically accurate black hole you can put in your room

https://blackhole.plav.in
17•aplavin•3d ago•1 comments

Show HN: CheapSecurity – Lightweight, Self-Hosted CCTV for Linux SBCs

https://github.com/gmrandazzo/CheapSecurity
104•zeldone•9h ago•22 comments

Show HN: Port Zero – how I learned to stop worrying and love PORT=0

https://portzero.net/
6•octopoc•1h ago•2 comments

Show HN: Reverse Minesweeper

https://sunflowersgame.com/
148•pompomsheep•13h ago•50 comments

Show HN: A 60-line PreToolUse hook that stops Claude Code from editing your .env

https://github.com/avenna01-ceo/claude-code-survival-kr/tree/main/guard
3•gaiinmaster•59m ago•0 comments

Show HN: Aqua UI for the Web

https://github.com/willmeyers/aqua-ui
2•willmeyers•1h ago•0 comments

Show HN: RelativeDB – OSS query engine for relational foundation models

https://github.com/RelativeDB/RelQL
3•scottcodie•1h ago•0 comments

Show HN: Simple HIIT timer for efficient workouts

https://www.hiitmeup.fit/
2•takee•1h ago•0 comments

Show HN: Turn an image into a 3D blockbench model

https://github.com/orca-gamedev/img2blockbench
3•ekduman•1h ago•0 comments

Show HN: Discrete6502 – one thing led to another

https://epatel.github.io/discrete6502/
6•epatel99•3h ago•2 comments

Show HN: Blind-box commerce made easy

https://chancey.run
2•13001r•1h ago•0 comments

Show HN: Infinite Jigsaw Game

https://infinitejigsaw.com
18•impostervt•5h ago•18 comments

Show HN: Lowkey Studio – Shader Powered visual effects compositor in the Browser

https://lowkeyviewer.com/studio/
2•tracerbulletx•2h ago•0 comments

Show HN: Paper – A Journaling CLI for Developers

https://paper.rewrlution.com
2•dmsehuang•2h ago•0 comments

Show HN: I mapped every US golf course

https://golfcoursebrowser.com/
200•rickmf•23h ago•147 comments

Show HN: Anyclaude-SDK – Claude Code-Style SDK for OpenAI/Anthropic Endpoints

https://github.com/pipilot-dev/anyclaude-sdk
2•hansade•3h ago•0 comments

Show HN: The Jac Programming Language

https://jaclang.org/
5•marsninja•3h ago•6 comments

Show HN: GG Translator – Turn gaming shit talk into friendly phrases

https://ggtranslator.com
2•mcadenhe•3h ago•0 comments

Show HN: LuaJIT with Native SIMD

https://github.com/TheLuaOSProject/LuaJITMT/releases/tag/1.0.0-simd
2•frityet•3h ago•1 comments

Show HN: A browser-based video editor that renders videos directly with FFmpeg

https://github.com/thiagoalbrecht/weave
14•thiagoas•11h ago•3 comments

Show HN: Introducing Odella [video]

https://www.youtube.com/watch?v=ZdMyH3sd62I
3•jordanhparker6•1h ago•0 comments

Show HN: Wmux – A workspace multiplexer for AI agents

https://github.com/openwong2kim/wmux
11•wong2kim•14h ago•0 comments

Show HN: Writemark, a dependency free web component for inline Markdown editing

51•_boffin_•1d ago•23 comments

Show HN: Echo – Fable-level results at 1/3 the cost using open-weight models

474•adam_rida•3d ago•222 comments

Show HN: Managing on-premise servers without Kubernetes

https://github.com/ricardoborges/Nautilus
16•r2ob•12h ago•11 comments

Show HN: Rucksack alpha CLI that pins a Mac to a hotspot and holds a sleep lease

https://github.com/noahnawara/rucksack
3•thirdface•7h ago•0 comments

Show HN: Open-plan-annotator – local annotation UI for working with agent plans

https://github.com/ndom91/open-plan-annotator
3•ndom91•7h ago•2 comments

Show HN: ModelFuzz – Open-source runtime guardrails for AI agents

https://www.modelfuzz.com/
2•higagan•7h ago•1 comments

Show HN: Brolly, a plain-text weather forecast site

https://brolly.sh/forecast/RWFP2qW8
221•jsax•1d ago•81 comments

Show HN: Readability for web and PDFs with TTS and local AI summary

https://github.com/ldenoue/readability-read-aloud-web-pdf-ai-summary
3•ldenoue•7h ago•2 comments