omar-polo / gmid

a Gemini server
https://gmid.omarpolo.com
ISC License
98 stars 8 forks source link

Proxy HTTP/Gemtext to Gemini protocol #23

Open d47081 opened 4 months ago

d47081 commented 4 months ago

It's possible to proxy pass gemini requests to gemtext formatted http resource?

Thanks

omar-polo commented 4 months ago

Can you be more specific?

Do you want to have gmid proxying something like the the duckling proxy? (it's a service that can be used as a gemini proxy and translates HTML pages in text/gemini)

Or the opposite, serving a gemini capsule via HTTP? (see for e.g. kineto or galileo.)

d47081 commented 4 months ago

I have website on Symfony and thoughts to just make separated gemtext templates there instead of create separated backend server for gemini

and pass those http/gemtext templates to gemini using gmid proxy.

in other words http://domain.com/gemtext-uri <- gmid gemini://domain.com/gemtext-uri <- user request

omar-polo commented 4 months ago

Ah, I see, so you'd use gmid' proxy to make an HTTP request and serve the reply via gemini. This isn't possible currently, as gmid proxy abilities are limited to speaking gemini only.

However, it shouldn't be difficult to implement. It would require some additions to the configuration file, and then the bare minimum to speak HTTP/1.1 (as a client.)

If you are interested in implementing this feature I'd be happy to help! (otherwise, no worries, I'll think about it and will eventually add to my todo list.)

d47081 commented 4 months ago

Yes,

I think that would be super-useful as no needs to make separated backend for every existing web resource, just template only (e.g. by passing GET ?mode=gemini request).

Thanks, following the news!

d47081 commented 3 months ago

Hello, how is it going?

Thoughts to create website on GitHub Pages using Gemtext format, then make proxy with gmid.

omar-polo commented 3 months ago

No progress has been made yet. It's an interesting feature and it's on my TODO,, it has even made me think on ways to extend gmid for use cases like this one.

By the way, I'm not sure serving from github pages would work, as I don't think it knows that files .gmi have a text/gemini mime type, so it'll probably serve them as text/plain or application/octet-stream.

d47081 commented 3 months ago

But it could be replaced/converted/filtered by proxy backend.

I suppose to send trough http formatted gemtext only, skip those headers and return this body with gemini header 20 / mime text/gemini. Maybe make some static files cache by the way..

Or maybe that's just really crazy idea :)

It is not easy to make alternative to Nginx, you're hero anyway! Wrote few articles to make gmid popular also.

Thank much for this work - I have only one server works fine as proxy between those madness I route here.