Reputation: 133
I'm trying to set up a goproxy server on Google cloud run. The go file with the corresponding Dockerfile below are working flawlessly when I run them locally.
Is something like this possible at all? From my limited understanding of proxies, using the CONNECT
method should work over https. What am I missing here?
package main
import (
"github.com/elazarl/goproxy"
"log"
"net/http"
"os"
)
func main() {
proxy := goproxy.NewProxyHttpServer()
proxy.Verbose = true
log.Fatal(http.ListenAndServe(":" + os.Getenv("PORT"), proxy))
}
FROM golang:1.14
WORKDIR /go/src/app
COPY goproxy.go /go/src/app/goproxy.go
RUN cd /go/src/app && go get -d -v .
CMD go run /go/src/app/goproxy.go
Upvotes: 4
Views: 2885
Reputation: 45302
Cloud Run does not support HTTP CONNECT
verb.
Your best bet is to make an HTTP reverse proxy (which is not possible with goproxy, or at least I found it to be pretty difficult).
Upvotes: 4