Use upstream inside kong custom plugin access function


#1

I am developing a custom plugin for authentication in which I make a rest api call to a service. I want to use one of the existing upstream to make that api call.
e.g. I have upstream -> auth-upstream with targets [localhost:9998,localhost:9999]
So inside of the plugin I want to call http://auth-upstream/auth/verify-token and kong will automatically load balance it or I can get all the targets corresponding to auth-upstream and I can use any random target for the api call.