Elegant996 / scgi-transport

SCGI reverse proxy transport module for Caddy
Apache License 2.0
15 stars 3 forks source link

Updates after Caddy v2.4.0 is released #2

Closed francislavoie closed 2 years ago

francislavoie commented 3 years ago

This is just an FYI, we've recently merged some changes that will land in v2.4.0 that change a bit how you should invoke the Caddyfile unmarshaler for the rpHandler.

https://github.com/caddyserver/caddy/commit/e4a22de9d1c4d7aa83126ee13e40b61e7b0e9df0#diff-6672fa0777d0d187809940a7d14eadf14ad36e4206c77f19822c67b668f1084c

In particular, you should add this bit of code after rpHandler.UnmarshalCaddyfile(dispenser)

    err = rpHandler.FinalizeUnmarshalCaddyfile(h)
    if err != nil {
        return nil, err
    }

This makes the new handle_response feature parse correctly.

(As an aside, just out of curiosity, what do you use SCGI for? What language/scgi server do you use it with? I've never used the protocol myself)

francislavoie commented 3 years ago

Also I noticed that you don't have a go.mod and go.sum in this repo, please add those files! Then you can register this plugin on https://caddyserver.com/download by making an account and claiming the plugin.

dbohdan commented 3 years ago

(As an aside, just out of curiosity, what do you use SCGI for? What language/scgi server do you use it with? I've never used the protocol myself)

Not speaking for the maintainer, but I can say that SCGI is fairly popular in the Tcl programming language community. Legacy code uses SCGI where in another language you would see FastCGI, and people still start new projects with it. D. Richard Hipp seems to like SCGI. His Fossil SCM and Wapp web framework both have first-class support for it.

Something you will notice if you go through SCGI server implementations on GitHub is libraries for niche, new, small, and less popular programming languages. SCGI is easier to implement from scratch than FastCGI or full HTTP/1.1. (It says something that FastCGI libraries for various languages tend to be bindings to the C reference implementation.) It allows you to put anything with TCP server sockets on the web quickly.

Edit: I would love to see this plugin available on https://caddyserver.com/download.

Elegant996 commented 2 years ago

Plugin is now available on https://caddyserver.com/download.

Thanks!