-
Notifications
You must be signed in to change notification settings - Fork 439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use custom listener when serving plugin #213
Comments
+1 this would be very useful, or even just providing us with a way to configure tcp/unix sockets in ServeConfig. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I really enjoy using this package, but I encountered a limitation when trying to serve plugins that listen on TCP instead than with UNIX sockets due to security limitations.
The
Serve
function, as shown in the examples, seems only to create UNIX sockets listeners when running on non-windows system.I tried a few things, first with a manually created server like this :
But I encountered an issue with the logger, as it is not initialized in the
server.Init
function, so the program crashes anytime, it tries to log with a segmentation error.I made it work by adding a field for a custom listener in the
ServeConfig
struct (server.go:58) and preventing calling theserverListener()
function in theServe
function. This way I can use the TCP listener like this :And this seems to be working fine.
I am not sure to fully understand this library that's why I didn't make a PR about this now. Is there another planned way of doing that? I can do a PR about it if needed.
If it helps, you can find my fork here : https://github.com/Anthony-Jhoiro/go-plugin/tree/feat/serve_custom_listener
I am using the latest package version and go 1.18.3 btw.
Thanks a lot !
The text was updated successfully, but these errors were encountered: