Skip to content

Support *.localhost URLs as an alternative to external tunnel services #666

@2chanhaeng

Description

@2chanhaeng

The fedify tunnel command currently relies on external tunneling services (localhost.run, serveo.net, pinggy.io). These services can be intermittently unavailable or rate-limited, causing tunnel failures during local development.

For purely local development and testing scenarios, we could support *.localhost URLs instead. Per RFC 6761, *.localhost subdomains resolve to 127.0.0.1 without any external dependency.

portless is a lightweight tool that replaces port numbers with stable, named .localhost URLs. It provides:

  • Automatic HTTPS with HTTP/2 via a local CA
  • Stable named URLs (e.g., https://myapp.localhost instead of http://localhost:3000)
  • No dependency on external services
  • Subdomain support (e.g., https://api.myapp.localhost)
  • Cross-platform support (macOS, Linux, Windows)

Proposal

Add a --local (or similar) option to fedify tunnel and related commands (fedify inbox, fedify lookup, fedify relay) that uses portless to assign a *.localhost URL to the local server instead of opening an external tunnel.

Example usage:

fedify tunnel 3000 --local        # -> https://fedify.localhost (no external tunnel)
fedify tunnel 3000 -s serveo.net  # -> existing behavior via external service

Benefits

  • Reliability: No dependency on third-party tunnel service availability
  • Speed: No network round-trip through an external proxy
  • Privacy: Traffic stays entirely on the local machine
  • Simplicity: Works offline with no account or API key required

Limitations

  • Only useful when both the client and server are on the same machine (or LAN with portless's --lan mode). External tunnel services are still needed for testing with remote fediverse instances.

Related

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions