GhangZh opened a new issue #53:
URL: https://github.com/apache/apisix-go-plugin-runner/issues/53


   ### Issue description
   I want to support the forward-auth , but how does go-pugin-runner support me 
to proxy the current request directly to the url, and then process the response 
and pass it on?
   I wrote a version in lua, but our technology stack is unified with go, so I 
want to use go to implement
   ```bash
       local core = require("apisix.core")
       local http = require("resty.http")
       local http_new = http.new()
       local res, err = http_new:request_uri("https://forward-auth.xxx.com";, {
           ssl_verify = false,
           method = "GET",
           headers = {
               ["X-Forwarded-User"] = core.request.header(ctx, 
"X-Forwarded-User"),
               ["X-Forwarded-UID"] = core.request.header(ctx, 
"X-Forwarded-UID"),
               ["Cookie"]=core.request.header(ctx,"Cookie")
           },
       })
       if err ~= nil then
           core.log.error("==== Serverless Request Error: ", err)
           return
       end
       if (res ~= nil) then
           for k, v in pairs(res.headers) do
               core.response.set_header(k, v)
           end
       end
       if res.status == 302 then
           core.response.set_header("Location", res.headers.location)
           core.response.exit(302)
           return
       end
   ```
   ### Environment
   
   * APISIX Go Plugin Runner's version:
   * APISIX version:
   * Go version:
   * OS (cmd: `uname -a`):
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to