caozhi6655 commented on issue #7298:
URL: https://github.com/apache/apisix/issues/7298#issuecomment-1162594955

   > @caozhi6655 Could you give a reproducible case? The custom plugin is vital 
and could you paste more codes about it?
   > 
   > You can remove all the private, business-related logic but the basic logic 
should be reserved, such as in which phase this plugin will be called.
   > 
   > And the route and upstream objects are expected.
   
   @tokers upstream like this `{
     "nodes": [
       {
         "host": "xxx",
         "port": xxx,
         "weight": 1
       }
     ],
     "timeout": {
       "connect": 6,
       "send": 6,
       "read": 6
     },
     "type": "roundrobin",
     "scheme": "grpc",
     "pass_host": "pass",
     "name": "proto.user.UserService-upstream",
     "keepalive_pool": {
       "idle_timeout": 60,
       "requests": 1000,
       "size": 320
     }
   }`
   
   route like this `
   path: /proto.user.UserService/*
   upstream:proto.user.UserService-upstream
   `
   lua plugin like this `
   function _M.rewrite(conf, ctx)
       if token then
           xxx
       else
           core.response.add_header("Content-Type", "application/grpc")
           core.response.add_header("grpc-status", "16")
           core.response.add_header("grpc-message", "UNAUTHENTICATED")
           return 200
       end
   end
   
   `


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