I am using the docker image Package boringproxy-linux-amd64 · GitHub as boringproxy server and client.
In docker logs I can find the following problem:
Failed to create client. Ensure the server is running. URL: https://test.domain.com/api/clients/?client-name=app
First idea was, that the docker cannot access internet or the server. But when I check the server logs I find this:
2022/12/03 10:47:37 http: panic serving 172.18.0.5:50324: runtime error: invalid memory address or nil pointer dereference
goroutine 925 [running]:
net/http.(*conn).serve.func1()
/usr/local/go/src/net/http/server.go:1802 +0xb9
panic({0x8a35a0, 0xce68b0})
/usr/local/go/src/runtime/panic.go:1047 +0x266
github.com/boringproxy/boringproxy.(*Api).handleClients(0xc0003af4a0, {0x9d3380, 0xc00038c380}, 0xc0001d9e00)
/build/api.go:267 +0x557
net/http.HandlerFunc.ServeHTTP(0xc000408b60, {0x9d3380, 0xc00038c380}, 0x5)
/usr/local/go/src/net/http/server.go:2047 +0x2f
net/http.StripPrefix.func1({0x9d3380, 0xc00038c380}, 0xc0001d9d00)
/usr/local/go/src/net/http/server.go:2090 +0x330
net/http.HandlerFunc.ServeHTTP(0x7f00b46d5ed8, {0x9d3380, 0xc00038c380}, 0x7f00b46cc108)
/usr/local/go/src/net/http/server.go:2047 +0x2f
net/http.(*ServeMux).ServeHTTP(0x40d247, {0x9d3380, 0xc00038c380}, 0xc0001d9d00)
/usr/local/go/src/net/http/server.go:2425 +0x149
github.com/boringproxy/boringproxy.(*Api).ServeHTTP(0x30, {0x9d3380, 0xc00038c380}, 0x10000c000287be0)
/build/api.go:37 +0x27
net/http.StripPrefix.func1({0x9d3380, 0xc00038c380}, 0xc0001d9c00)
/usr/local/go/src/net/http/server.go:2090 +0x330
net/http.HandlerFunc.ServeHTTP(0x91e539, {0x9d3380, 0xc00038c380}, 0xc0003af4a0)
/usr/local/go/src/net/http/server.go:2047 +0x2f
github.com/boringproxy/boringproxy.Listen.func2({0x9d3380, 0xc00038c380}, 0xc0001d9c00)
/build/boringproxy.go:290 +0x3df
net/http.HandlerFunc.ServeHTTP(0x0, {0x9d3380, 0xc00038c380}, 0x0)
/usr/local/go/src/net/http/server.go:2047 +0x2f
net/http.(*ServeMux).ServeHTTP(0xc0003bc492, {0x9d3380, 0xc00038c380}, 0xc0001d9c00)
/usr/local/go/src/net/http/server.go:2425 +0x149
net/http.serverHandler.ServeHTTP({0xc00024bec0}, {0x9d3380, 0xc00038c380}, 0xc0001d9c00)
/usr/local/go/src/net/http/server.go:2879 +0x43b
net/http.(*conn).serve(0xc0003a6460, {0x9d56e0, 0xc0003af800})
/usr/local/go/src/net/http/server.go:1930 +0xb08
created by net/http.(*Server).Serve
/usr/local/go/src/net/http/server.go:3034 +0x4e8
I can reproduce it by just calling the url Welcome dragndropbuilder.com - BlueHost.com in browser.
When I change the parameter name “client-name” to something else I get the normal boringproxy respond “Missing client-name parameter”.