Skip to content
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

Allow to disable GRPC/HTTP listener #286

Open
thampiotr opened this issue May 5, 2023 · 2 comments
Open

Allow to disable GRPC/HTTP listener #286

thampiotr opened this issue May 5, 2023 · 2 comments

Comments

@thampiotr
Copy link
Contributor

Problem:

When using common/server/server.go to serve only HTTP traffic, there currently is no way to entirely disable the GRPC listener. Conversely, when only using GRPC, the HTTP listener will always be started.

This can be an issue when you want to e.g. limit the attack surface area, reduce the resource usage etc.

Proposed solution:

Add HTTPDisabled and GRPCDisabled configuration options that, when set to true, will disable HTTP and GRPC servers respectively.

Discussion

Have we ever considered this in the past, and is there a reason we decided against it?
I’m curious to hear what are your thoughts on this approach?
Are there any alternatives that you would recommend?
Would you be open to a contribution?

@bboreham
Copy link
Collaborator

I don't recall any discussion. I think when this library started the Server didn't do much beyond set up two listeners.

Could we re-use one of the existing parameters, e.g. GRPCListenPort=-1 would disable it?

@thampiotr
Copy link
Contributor Author

Thanks @bboreham. I'm happy to reuse the existing parameters and I don't see a problem with using -1 port to mean disabling a given server.

I will aim to open a PR implementing this - do let me know if you have any further concerns though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants