20 comments

  • ignoramous 5 days ago 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

    • ASalazarMX 4 days ago ago

      It's a very unconvincing tale when the origin story of this service is that the author connected to the wrong backend because he used the wrong port. I can see nothing simpler and more straightforward than numbered ports. Even the SRV record seems unnecesary complex for most use cases.

    • yjftsjthsd-h 5 days ago ago

      Yep, my immediate reaction was "because browsers refuse to support SRV records" (although I think there was some new variant that kinda worked?)

      • octopoc 5 days ago ago

        True! But, you wouldn't just need SRV support in browsers--you'd need it in every part of your dev environment / stack that touches the network. If your backend talks to a database, then your backend needs to support SRV. So you need SRV support in your standard library and your browser.

        But at a larger level this tool just makes everything work so smoothly. If you have two services with the same name, it pops up a notification in the tray. If you start a new process with a different name, you don't have to configure SRV; the DNS just becomes available automatically. HTTPS is auto configured. That sort of thing.

        I think somebody could one day make something like this that was based on SRV, but it would still need all those niceties to make it work well for developers.

  • dasyatidprime 4 days ago ago

    For those interested in the history of alternatives to port numbers: Chaosnet[1] in LispM/ITS times used names for describing which service was being requested. On the TCP side, a spec for requesting services by name has existed since 1988: TCPMUX[2], using a short initial handshake after connecting to port 1. Just never caught on AFAIK.

    [1] https://chaosnet.net/protocol#application_layer [2] https://datatracker.ietf.org/doc/html/rfc1078

  • giobox 15 hours ago ago

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

    It's not much extra work to do this technique (tunnel to publicly accessible domain name from locally or privately hosted setup) with cloudflare tunnels. It's also completely free, all you need is a domain name managed by cloudflare (~10 bucks a year).

    You just throw up a cloudflared container (can be part of your local docker compose stack), it will serve whatever you like from that local system at the public domain name - no port forwarding, no IP configuration, just works, over private VPN tunnel.

    I use this all the time for personal projects:

    > https://developers.cloudflare.com/tunnel/

    Unlimited cloud tunnels for 49 dollars a month is not that great - you can have up to 1000 tunnels on the free cloudflare plan, which I'm realistically never going to max out. Once you've done it once, it's a handful of lines to paste into any future compose stack with your Cloudflare API key to use again, it's incredibly simple to use, and will do the same automatic HTTPS setup.

  • snowe2010 4 days ago ago

    Wild to vibe code something in a week then charge $50/month for it. I understand servers cost money but lol there’s no way the costs are that high. Also insane the amount of code generated here.

    • IncreasePosts 4 days ago ago

      Why not charge $50/month for it? So little effort has been put into the endeavor that it failing to attract a single user wouldn't be heartbreaking

    • randallsquared 4 days ago ago

      The part that is being charged for isn't the coding, but the operating. How little should someone charge to be on pagerduty 24/7?

      • zamadatix 15 hours ago ago

        That's like asking why the first bag of goldfish shouldn't cover the cost of running the factory. How much support does an account need that it's expected to cost $50/m at volume to service the interactions?

        Also I couldn't find anything saying what "priority support" actually involves. The terms have a generic intent to reply in 2 business days note, but nothing about what kind of coverage the different tiers get or guarantee someone is actually going to respond to the pager 24/7 if something wonky happens in the cloud.

  • wannabe44 5 days ago ago

    > 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.

    I have never faced this problem even though I hard-code the port. It's because I run the server program through VS Code's debugger. If there's already a session, it would warn me.

    • drpotato 4 days ago ago

      Well, there's your problem! You're not getting the efficiency gains of multi-agent slop slinging loops working like that…

      • wannabe44 4 days ago ago

        I am seriously considering taking a break from this industry when it goes to the dogs and hustlemaxxers (approximately the same thing).

  • Uptrenda 4 days ago ago

    I get the problem well. I have built a networking runtime and a Python networking library that extensively used servers as part of testing. If you bind to a specific port and reuse it, you can end up with false failures due to:

    - old / zombie server processes

    - sockets that weren't properly cleaned up

    - TIME_WAITs

    my solution wasn't anything as clever as OPs though. Basically, I ended up conceiving of 127/8 as a rotating ring. Where you can pass offsets and easily end up on an unused bind tup every time. 127/8 gives you a huge number of IPs to play with. You just make address handling part of your test launcher and it sets a new IP each time.

    The issue is it doesn't really work for IPv6 (v6 localhost is only one address!) Though global-scope v6 interface blocks and manually assigned link-local scope, you could accomplish much the same thing.

  • mjmas 15 hours ago ago

    Why not have your program just listen on port 80 on an address under 127.0.0.0/8?

    You will need to run

      sysctl net.ipv4.ip_unprivileged_port_start=80
    
    before you start, but after that you have 2 ** 24 addresses to choose from. And the browser will be happy to treat it as a secure page as well as do proper cookie isolation.
    • neilalexander 6 hours ago ago

      The CAP_NET_BIND_SERVICE capability on Linux is far less of a blunt instrument that applies to a single process rather than system-wide.

    • c-hendricks 14 hours ago ago

      Is that the only thing governing unprivileged ports, or do programs also implement their own rules?

  • AsyncBanana 15 hours ago ago

    I have never really needed something like this. The cloud aspect is a bit different, but Tailscale already does that better at a way lower price.

  • protocolture 15 hours ago ago

    >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.

    For 50 dollars a month you can rent my WebNote application, where you can write down the ports you are using for each of your development applications. With this amazing technology you can compare your environment issues against your documented port choices eliminating port conflicts forever.

  • Uptrenda 15 hours ago ago

    I'm so confused: why does it say this thread was created 19 hours ago when this thread was posted like days ago? It says the same thing for my own comments here that were also posted days ago? What is going on? Have I missed something with how HN works?