hashicorp / go-plugin

Golang plugin system over RPC.
Mozilla Public License 2.0
5.25k stars 450 forks source link

Can the plug-in not expose the port, the main service exposed one is OK? #318

Open zhanbei1 opened 1 week ago

zhanbei1 commented 1 week ago

Plugins implemented using go-plugin require an RPC port each time, which is sometimes not allowed on the client's business server.

And I have a requirement: the plug-in collects metrics on the server, reports them to the master, and hopefully the master manages the plug-in.

I had a whimper about whether I could open a port on the master service and then accept all plug-ins, passing the port exposed by the master service to the plug-in when the master service starts the plug-in.

I'm not sure if this is feasible or if it's different from what the go-plugin project was created for.