Skip to content

Commit

Permalink
add grpc-web
Browse files Browse the repository at this point in the history
  • Loading branch information
RogerKSI committed Aug 7, 2023
1 parent e58d4df commit 0961d53
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
22 changes: 19 additions & 3 deletions docker-config/app.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ prometheus-retention-time = 0
#
# Example:
# [["chain_id", "cosmoshub-1"]]
global-labels = [
]
global-labels = []

###############################################################################
### API Configuration ###
Expand Down Expand Up @@ -122,7 +121,7 @@ rpc-write-timeout = 0
rpc-max-body-bytes = 1000000

# EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk).
enabled-unsafe-cors = false
enabled-unsafe-cors = true

###############################################################################
### gRPC Configuration ###
Expand All @@ -136,6 +135,23 @@ enable = true
# Address defines the gRPC server address to bind to.
address = "0.0.0.0:9090"


###############################################################################
### gRPC Web Configuration ###
###############################################################################

[grpc-web]

# GRPCWebEnable defines if the gRPC-web should be enabled.
# NOTE: gRPC must also be enabled, otherwise, this configuration is a no-op.
enable = true

# Address defines the gRPC-web server address to bind to.
address = "0.0.0.0:9091"

# EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk).
enable-unsafe-cors = true

###############################################################################
### State Sync Configuration ###
###############################################################################
Expand Down
7 changes: 7 additions & 0 deletions proxy-ssl/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ http {
proxy_set_header Connection $connection_upgrade;
}

location ^~/grpc-web/ {
proxy_pass http://query-node:9091/;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}

location ^~/hasura/ {
proxy_pass http://graphql-engine:8080/;
proxy_set_header Host $host;
Expand Down

0 comments on commit 0961d53

Please sign in to comment.