Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting up a forward proxy on Google cloud run

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?

Go file

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))
}

Dockerfile

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
like image 576
Johnny Avatar asked Nov 16 '25 01:11

Johnny


1 Answers

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).

like image 70
ahmet alp balkan Avatar answered Nov 17 '25 19:11

ahmet alp balkan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!