我用自己的ReverseProxy做了一些麻烦我用Go写的.我想将我的Golang-Webserver与我的Apache Webserver连接起来.我的Apache Web服务器也应该在https和反向代理上运行.所以我写了下面的代码,但我总是得到错误:代理错误:x509:由未知权限签署的证书.那么apache必须使用与apache相同的证书或者问题是什么?这里有一些代码片段,但我认为它没有ssl证书的问题一切正常:(
func (p *Proxy) directorApache(req *http.Request) {
mainServer := fmt.Sprintf("%s:%d", Config.HostMain, Config.PortMain)
req.URL.Scheme = "https"
req.URL.Host = mainServer
}
func (p *Proxy) directorGo(req *http.Request) {
goServer := fmt.Sprintf("%s:%d", Config.GoHost, Config.GoPort)
req.URL.Scheme = "http"
req.URL.Host = goServer
}
func (p *Proxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
fmt.Println(req.URL.Path)
if p.isGoRequest(req) {
fmt.Println("GO")
p.goProxy.ServeHTTP(rw, req)
return
}
p.httpProxy.ServeHTTP(rw, req)
}
func main() {
var configPath = flag.String("conf", "./configReverse.json", "Path to the Json config file.")
flag.Parse()
proxy := New(*configPath)
cert, err := …Run Code Online (Sandbox Code Playgroud) 我想删除我的canvas元素的文本,没有松动的Background-Image的Canvas-Element.
我想我需要保存Imagesrc并将其退回到Canvas-Elementa后clearRect,但我不知道该怎么做.
我希望有人可以帮助我.