-
Notifications
You must be signed in to change notification settings - Fork 92
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
Conversation
Signed-off-by: Joe Elliott <[email protected]>
Signed-off-by: Joe Elliott <[email protected]>
There was a problem hiding this 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
if err == grpc.ErrServerStopped { | ||
err = nil | ||
} | ||
|
||
select { | ||
case errChan <- err: | ||
default: | ||
} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup. done.
Signed-off-by: Joe Elliott <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
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.