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

Add support to route both GRPC and HTTP over the HTTP server #288

Merged
merged 3 commits into from
May 11, 2023

Conversation

joe-elliott
Copy link
Contributor

This PR uses https://github.com/soheilhy/cmux to provide the ability to route both HTTP and GRPC over the HTTP port with all of the GRPC server settings.

Currently it routes http1 to the http server and all http2 to the GRPC server.

Signed-off-by: Joe Elliott <[email protected]>
Copy link
Collaborator

@bboreham bboreham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM but I think extracting part to a function will make the whole thing easier to follow.

server/server.go Outdated
Comment on lines 546 to 553
if err == grpc.ErrServerStopped {
err = nil
}

select {
case errChan <- err:
default:
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is getting a bit repetitive - three exact copies of these 8 lines, plus two more of just the select.
Can I suggest extracting to a function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup. done.

Copy link
Collaborator

@bboreham bboreham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

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 this pull request may close these issues.

2 participants