Skip to content

Commit

Permalink
update regions, add --http2 to curl example
Browse files Browse the repository at this point in the history
Signed-off-by: Ahmet Alp Balkan <[email protected]>
  • Loading branch information
ahmetb committed Oct 12, 2020
1 parent 94ee4b4 commit b5cc7ca
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
4 changes: 2 additions & 2 deletions example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ func curl(w http.ResponseWriter, req *http.Request) {

w.Header().Set("content-type", "text/plain; charset=UTF-8")

fmt.Fprintf(w, "$ curl -sSLv %s\n\n", url)
cmd := exec.Command("curl", "-sSLv", url)
fmt.Fprintf(w, "$ curl -sSLv --http2 %s\n\n", url)
cmd := exec.Command("curl", "-sSLv", "--http2", url)
cmd.Stdout = w
cmd.Stderr = w
if err := cmd.Run(); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion runsd/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (rp *reverseProxy) newReverseProxyHandler(tr http.RoundTripper) http.Handle
transport := loggingTransport{next: tokenInject}

return &httputil.ReverseProxy{
Transport: transport,
Transport: transport,
FlushInterval: -1, // to support grpc streaming responses
Director: func(req *http.Request) {
klog.V(5).Infof("[director] receive req host=%s", req.Host)
Expand Down
22 changes: 13 additions & 9 deletions runsd/regions.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,19 @@ import (
var (
// TODO needs updating
cloudRunRegionCodes = map[string]string{
"asia-east1": "de",
"asia-northeast1": "an",
"europe-north1": "lz",
"europe-west1": "ew",
"europe-west4": "ez",
"us-central1": "uc",
"us-east1": "ue",
"us-east4": "uk",
"us-west1": "uw",
"asia-east1": "de",
"asia-northeast1": "an",
"asia-northeast2": "dt",
"asia-southeast1": "as",
"australia-southeast1": "ts",
"europe-north1": "lz",
"europe-west1": "ew",
"europe-west4": "ez",
"northamerica-northeast1": "nn",
"us-central1": "uc",
"us-east1": "ue",
"us-east4": "uk",
"us-west1": "uw",
}
)

Expand Down

0 comments on commit b5cc7ca

Please sign in to comment.