Conversation
|
Also, I had to use full abs paths to the cert/key files. This makes it complicated when using tools like Just or Task in a shared environment. I tried using |
|
I tried to push to this PR but couldn't. I was able to get this working - here is the change I made:
go func() {
var err error <<<<
cmd.Log.Info("Proxying", slog.String("from", p.URL), slog.String("to", p.Target.String()))
server := &http.Server{
Addr: fmt.Sprintf("%s:%d", cmd.Args.ProxyBind, cmd.Args.ProxyPort),
Handler: p,
}
// Configure TLS if certificates are provided.
if cmd.Args.ProxyTLSCrt != "" && cmd.Args.ProxyTLSKey != "" {
cert, err := tls.LoadX509KeyPair(cmd.Args.ProxyTLSCrt, cmd.Args.ProxyTLSKey)
if err != nil {
cmd.Log.Error("Failed to load TLS certificates", slog.Any("error", err))
return
}
server.TLSConfig = &tls.Config{Certificates: []tls.Certificate{cert}}
err = server.ListenAndServeTLS("", "") <<<<
} else { <<<<
err = server.ListenAndServe() <<<<
}
if err != nil { <<<<
cmd.Log.Error("Proxy failed", slog.Any("error", err))
}
}() |
|
Ah, good point re: ListenTLS. Instead of using There's nothing in the code that makes it use absolute paths, relative paths like |
That works... Everything, so far, seems to be working as expected. Thank you! |



Closes #1329