-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
gRPC-web proxy #8077
Merged
Merged
gRPC-web proxy #8077
Changes from 35 commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
6aa0309
init
aleem1314 93a277f
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into al…
aleem1314 efaa0b4
WIP config
aleem1314 939eb79
WIP add proxy server
aleem1314 f4f98eb
fmt
aleem1314 e3b7ab1
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into al…
aleem1314 758b4bb
WIP
aleem1314 34c4eb6
setup proxy server
aleem1314 e737111
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into al…
aleem1314 8ff60e3
clean go.mod
aleem1314 d2cabcd
lint
aleem1314 a5d90bc
lint
aleem1314 dd6a000
lint
aleem1314 222d1cf
custom codec
aleem1314 a5e7dbf
lint
aleem1314 34cbea8
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into al…
aleem1314 e2e1704
add comments
aleem1314 3e1e495
change grpc-proxy port
aleem1314 95a71ac
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into al…
aleem1314 aaddeca
add grpc-web
aleem1314 2473fc8
Merge branch 'master' into aleem/7345-grpc-web-proxy
aleem1314 a29f2a4
update server/start.go
aleem1314 805aa20
Merge branch 'master' into aleem/7345-grpc-web-proxy
aleem1314 72f0ce1
add tests
aleem1314 7d3bfe0
Merge branch 'aleem/7345-grpc-web-proxy' of https://github.com/cosmos…
aleem1314 c074ece
Merge branch 'master' into aleem/7345-grpc-web-proxy
aleem1314 d57513d
add test with client
aleem1314 4ffc71b
Merge branch 'aleem/7345-grpc-web-proxy' of https://github.com/cosmos…
aleem1314 4debd21
Update server/start.go
aleem1314 72f4aeb
Merge branch 'master' into aleem/7345-grpc-web-proxy
aleem1314 b8bb16b
Update server/start.go
aleem1314 f3bc9c6
Update server/start.go
aleem1314 6e2f070
review changes
aleem1314 5468ca0
review changes
aleem1314 260276a
Merge branch 'master' into aleem/7345-grpc-web-proxy
anilcse 9ba7192
Merge branch 'master' into aleem/7345-grpc-web-proxy
alexanderbez 24e8f9e
Update server/start.go
alexanderbez 8b14c71
Merge branch 'master' into aleem/7345-grpc-web-proxy
mergify[bot] c5e7fc6
Merge branch 'master' into aleem/7345-grpc-web-proxy
mergify[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package grpc | ||
|
||
import ( | ||
"net/http" | ||
|
||
"github.com/cosmos/cosmos-sdk/server/config" | ||
"github.com/improbable-eng/grpc-web/go/grpcweb" | ||
"google.golang.org/grpc" | ||
) | ||
|
||
// StartGRPCWeb starts a gRPC-Web server on the given address. | ||
func StartGRPCWeb(grpcSrv *grpc.Server, config config.Config) (*http.Server, error) { | ||
wrappedServer := grpcweb.WrapServer(grpcSrv) | ||
handler := func(resp http.ResponseWriter, req *http.Request) { | ||
wrappedServer.ServeHTTP(resp, req) | ||
} | ||
grpcWebSrv := &http.Server{ | ||
Addr: config.GRPCWeb.Address, | ||
Handler: http.HandlerFunc(handler), | ||
} | ||
if err := grpcWebSrv.ListenAndServe(); err != nil { | ||
return nil, err | ||
} | ||
return grpcWebSrv, nil | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We could also just keep the
enable
config, and if true, bind the server to the HTTP port. I'm not sure it's useful to expose so many ports. wdyt?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.
I tried to bind to the HTTP server. Getting this error.
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.
I created this issue to discuss it: #8254