mirror of
https://github.com/m1k1o/neko-rooms.git
synced 2026-11-03 07:01:35 -06:00
proxy fix logging.
This commit is contained in:
@@ -68,11 +68,13 @@ func (p *ProxyManagerCtx) Start() {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
host := msg.ID[:12] + ":" + port
|
||||||
|
|
||||||
p.logger.Info().
|
p.logger.Info().
|
||||||
Str("action", msg.Action).
|
Str("action", msg.Action).
|
||||||
Str("path", path).
|
Str("path", path).
|
||||||
Str("port", port).
|
Str("host", host).
|
||||||
Msg("new docker event")
|
Msg("got docker event")
|
||||||
|
|
||||||
p.mu.Lock()
|
p.mu.Lock()
|
||||||
switch msg.Action {
|
switch msg.Action {
|
||||||
@@ -81,7 +83,7 @@ func (p *ProxyManagerCtx) Start() {
|
|||||||
case "start":
|
case "start":
|
||||||
proxy := httputil.NewSingleHostReverseProxy(&url.URL{
|
proxy := httputil.NewSingleHostReverseProxy(&url.URL{
|
||||||
Scheme: "http",
|
Scheme: "http",
|
||||||
Host: msg.ID[:12] + ":" + port,
|
Host: host,
|
||||||
})
|
})
|
||||||
|
|
||||||
p.handlers.Set(path, proxy)
|
p.handlers.Set(path, proxy)
|
||||||
@@ -124,11 +126,13 @@ func (p *ProxyManagerCtx) Refresh() error {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
host := cont.ID[:12] + ":" + port
|
||||||
|
|
||||||
var proxy *httputil.ReverseProxy
|
var proxy *httputil.ReverseProxy
|
||||||
if cont.State == "running" {
|
if cont.State == "running" {
|
||||||
proxy = httputil.NewSingleHostReverseProxy(&url.URL{
|
proxy = httputil.NewSingleHostReverseProxy(&url.URL{
|
||||||
Scheme: "http",
|
Scheme: "http",
|
||||||
Host: cont.ID[:12] + ":" + port,
|
Host: host,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user