21 votes

I wanted a better Gemini web proxy, so I built a single-file PHP gateway

14 comments

  1. [6]
    shoelace
    Link
    (Off-topic) I really resent that Google named their LLM Gemini, years after the Gemini protocol was already well-established. Now I instinctively tune out any tech-related post that mentions the...

    (Off-topic)

    I really resent that Google named their LLM Gemini, years after the Gemini protocol was already well-established. Now I instinctively tune out any tech-related post that mentions the word Gemini, which causes me to almost miss cool stuff like this.

    And this isn't even the most egregious example of Google doing something like this that I know of – I can't imagine how pissed off I'd be if I was the creator of the 'Go!' programming language...

    19 votes
    1. [4]
      bitshift
      Link Parent
      Before I got to your second paragraph, I also was thinking of the Go! language. (Wiki article for folks who haven't seen it.)

      Before I got to your second paragraph, I also was thinking of the Go! language. (Wiki article for folks who haven't seen it.)

      9 votes
      1. [3]
        hamstergeddon
        Link Parent
        Maybe I'm attaching too much snarky superiority to it, but damn that kinda pisses me off.

        The issue thread opened on the subject was closed by a Google developer on 12 October 2010 with the custom status "Unfortunate"

        Maybe I'm attaching too much snarky superiority to it, but damn that kinda pisses me off.

        2 votes
        1. bitshift
          Link Parent
          It might be one of those situations where no matter what they had said, it would have sounded bad. Realistically, the name was never going to change, so you can't have a proper apology: "Hey,...

          It might be one of those situations where no matter what they had said, it would have sounded bad.

          Realistically, the name was never going to change, so you can't have a proper apology: "Hey, sorry for taking the name, but actually not sorry because we want it more than you do." And maybe they really did feel bad about stepping on someone's toes, and they wanted to acknowledge that. But sometimes a token gesture is worse than nothing.

          4 votes
        2. Englerdy
          Link Parent
          Hard not to read it and go "what a dick." ( *-_-)

          Hard not to read it and go "what a dick." ( *-_-)

          1 vote
    2. 0x29A
      Link Parent
      Yep! I had the same experience and I resent it too. "Gemini? Ew.... oh wait, not that Gemini, phew"

      Yep! I had the same experience and I resent it too. "Gemini? Ew.... oh wait, not that Gemini, phew"

      5 votes
  2. [5]
    tdkx21
    Link
    I wanted an easy way to browse gemini:// sites on standard web browsers, but I couldn't find an online proxy that felt fast, clean, and self-hostable enough for daily use—so I built one. It is a...

    I wanted an easy way to browse gemini:// sites on standard web browsers, but I couldn't find an online proxy that felt fast, clean, and self-hostable enough for daily use—so I built one.

    It is a zero-dependency, single-file PHP script that translates Gemini (gemini://) and Titan (titan://) protocol requests directly into web-friendly HTML.

    Key Features:

    • Dual Protocol Support: Uses native TLS sockets to fetch Gemini pages and submit uploads via Titan.
    • Robust Gemtext Parser: Converts Gemtext (text/gemini) into clean HTML elements, handling headings, lists, blockquotes, and code blocks.
    • Seamless Navigation: Automatically rewrites relative and absolute internal URLs back through the proxy.
    • Custom Color Schemes: Supports quick query parameters (example "?bg=000&text=fff") to pass custom CSS themes.
    • Interactive Controls: Native form support for Gemini input prompts (Status 10/11) and Titan file uploads.
    • Debug Telemetry: A collapsible footer details drawer showing connection latency, status codes, target host, and MIME info.
    11 votes
    1. [4]
      edoceo
      Link Parent
      Is the page the Gemini docs? How can we see your code? Are you sharing that part?

      Is the page the Gemini docs? How can we see your code? Are you sharing that part?

      2 votes
      1. [3]
        tdkx21
        Link Parent
        You are right I should have shared the code earlier but here you go: https://github.com/User32-128/gmsurf

        You are right I should have shared the code earlier but here you go:
        https://github.com/User32-128/gmsurf

        1 vote
        1. [2]
          edoceo
          Link Parent
          Thanks! Looks good. Curious why you used the PHP ob_handler? I generally let PHP output get compressed by the next stage (Caddy). I only pick that way from habit and some unsubstantiated beliefs...

          Thanks! Looks good. Curious why you used the PHP ob_handler? I generally let PHP output get compressed by the next stage (Caddy). I only pick that way from habit and some unsubstantiated beliefs that the PHP ob is slower than my webserver .

          1 vote
          1. tdkx21
            Link Parent
            Good catch! I threw that in out of habit for portable scripts where server compression isn't guaranteed. Since this is running on Wasmer, the Edge gateway handles Gzip/Brotli upstream anyway....

            Good catch! I threw that in out of habit for portable scripts where server compression isn't guaranteed.

            ​Since this is running on Wasmer, the Edge gateway handles Gzip/Brotli upstream anyway. Doing it inside PHP is just burning unnecessary Wasm CPU and memory overhead. Dropping it in the next commit!

  3. [3]
    skybrian
    Link
    It seems to be having trouble loading?

    It seems to be having trouble loading?

    1 vote
    1. [2]
      tdkx21
      Link Parent
      can you please elaborate on the problems you are facing so I could better help you

      can you please elaborate on the problems you are facing so I could better help you

      1. skybrian
        Link Parent
        It’s working now.

        It’s working now.

        1 vote