mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-20 12:42:34 +02:00
fix duplicated routes not being shown
This commit is contained in:
parent
816166a30a
commit
a319957f3e
4 changed files with 8 additions and 2 deletions
|
@ -163,7 +163,7 @@ func (cfg *AgentConfig) Name() string {
|
|||
}
|
||||
|
||||
func (cfg *AgentConfig) String() string {
|
||||
return "agent@" + cfg.Addr
|
||||
return cfg.name + "@" + cfg.Addr
|
||||
}
|
||||
|
||||
func (cfg *AgentConfig) MarshalJSON() ([]byte, error) {
|
||||
|
|
|
@ -170,7 +170,7 @@ func (cfg *Config) StartAutoCert() {
|
|||
}
|
||||
|
||||
func (cfg *Config) StartProxyProviders() {
|
||||
errs := cfg.providers.CollectErrorsParallel(
|
||||
errs := cfg.providers.CollectErrors(
|
||||
func(_ string, p *proxy.Provider) error {
|
||||
return p.Start(cfg.task)
|
||||
})
|
||||
|
|
|
@ -97,6 +97,9 @@ func (r *ReveseProxyRoute) String() string {
|
|||
|
||||
// Start implements task.TaskStarter.
|
||||
func (r *ReveseProxyRoute) Start(parent task.Parent) E.Error {
|
||||
if existing, ok := routes.GetHTTPRoute(r.TargetName()); ok {
|
||||
return E.Errorf("route already exists: from provider %s and %s", existing.ProviderName(), r.ProviderName())
|
||||
}
|
||||
r.task = parent.Subtask("http."+r.TargetName(), false)
|
||||
|
||||
switch {
|
||||
|
|
|
@ -47,6 +47,9 @@ func (r *StreamRoute) String() string {
|
|||
|
||||
// Start implements task.TaskStarter.
|
||||
func (r *StreamRoute) Start(parent task.Parent) E.Error {
|
||||
if existing, ok := routes.GetStreamRoute(r.TargetName()); ok {
|
||||
return E.Errorf("route already exists: from provider %s and %s", existing.ProviderName(), r.ProviderName())
|
||||
}
|
||||
r.task = parent.Subtask("stream." + r.TargetName())
|
||||
r.Stream = NewStream(r)
|
||||
parent.OnCancel("finish", func() {
|
||||
|
|
Loading…
Add table
Reference in a new issue