mirror of
https://github.com/umputun/reproxy.git
synced 2025-11-23 22:04:57 +02:00
change docker default and add autoapi param #20
This commit is contained in:
@@ -26,6 +26,7 @@ type Docker struct {
|
||||
DockerClient DockerClient
|
||||
Excludes []string
|
||||
Network string
|
||||
AutoAPI bool
|
||||
}
|
||||
|
||||
// DockerClient defines interface listing containers and subscribing to events
|
||||
@@ -71,7 +72,10 @@ func (d *Docker) List() ([]discovery.URLMapper, error) {
|
||||
|
||||
res := make([]discovery.URLMapper, 0, len(containers))
|
||||
for _, c := range containers {
|
||||
srcURL := fmt.Sprintf("^/api/%s/(.*)", c.Name)
|
||||
srcURL := "^/(.*)"
|
||||
if d.AutoAPI {
|
||||
srcURL = fmt.Sprintf("^/api/%s/(.*)", c.Name)
|
||||
}
|
||||
destURL := fmt.Sprintf("http://%s:%d/$1", c.IP, c.Port)
|
||||
pingURL := fmt.Sprintf("http://%s:%d/ping", c.IP, c.Port)
|
||||
server := "*"
|
||||
|
||||
Reference in New Issue
Block a user