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

21 points by tdkx21 a day ago on tildes | 14 comments

shoelace | a day ago

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

bitshift | a day ago

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

hamstergeddon | 14 hours ago

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.

bitshift | 11 hours ago

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.

Englerdy | 14 hours ago

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

0x29A | a day ago

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

[OP] tdkx21 | a day ago

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.

edoceo | 22 hours ago

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

[OP] tdkx21 | 20 hours ago

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

edoceo | 10 hours ago

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 .

[OP] tdkx21 | 8 hours ago

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!

skybrian | a day ago

It seems to be having trouble loading?

[OP] tdkx21 | 20 hours ago

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

skybrian | 16 hours ago

It’s working now.