caddyserver / caddy

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
https://caddyserver.com
Apache License 2.0
58.46k stars 4.04k forks source link

Move Fastcgi client implementation to its own package #4378

Open gsdevme opened 3 years ago

gsdevme commented 3 years ago

Hi,

I've been looking for a client fastcgi implementation in Golang and the one is Caddy seems very feature rich, however although the client.go is using only the standard library the fastcgi.go and caddyfile.go are using alot of other things.

Would it be acceptable to move the pure fastcgi implementation which is designed around http://www.mit.edu/~yandros/doc/specs/fcgi-spec.html into its own package to allow easier consumption with other libraries and applications? I assume the implementation at this point is "completed" given there has never been any real movement I wonder if that would be acceptable to have it away from Caddy's development and just sit standalone?

Thanks in advance.

mholt commented 3 years ago

Sure, that's not a bad idea; but before that happens, the implementation needs to be rewritten: https://github.com/caddyserver/caddy/issues/3803

I would not recommend other applications using the implementation as-is.

gsdevme commented 3 years ago

Interesting, I struggled to find a implementation to begin with really but I've looked at the others mentioned there on that issue. I will take a closer look although not sure gopher skills can help exactly here 😃

mholt commented 6 months ago

FWIW, @WeidiDeng has rewritten the fastcgi package and it's much better now. It's still a Caddy-centric package, so it's not decoupled in the sense you're requesting, but it should be much more worthwhile to extract it now.

It's not really an action item on my list, but if someone else wants to take this up, that's great too.

eanavitarte commented 4 months ago

FWIW, @WeidiDeng has rewritten the fastcgi package and it's much better now. It's still a Caddy-centric package, so it's not decoupled in the sense you're requesting, but it should be much more worthwhile to extract it now.

It's not really an action item on my list, but if someone else wants to take this up, that's great too.

Hi @mholt, I helped with this issue by opening a PR #6465. The goal was to carefully extract the client logic into a separate package, for readability and reusability. Let me know what you think!

mholt commented 4 months ago

Oh wow, thank you! I will take a look soon :)