merge develop into master #21
@ -75,8 +75,12 @@ func buildTcp(ctx context.Context, p *proxy.Proxy, peer Peer, g func() proxy.Mac
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !peer.DisableConsumer {
|
||||||
p.AddConsumer(ctx, f, g())
|
p.AddConsumer(ctx, f, g())
|
||||||
|
}
|
||||||
|
if !peer.DisableProducer {
|
||||||
p.AddProducer(ctx, f, v())
|
p.AddProducer(ctx, f, v())
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -121,8 +125,12 @@ func buildUdp(ctx context.Context, p *proxy.Proxy, peer Peer, g func() proxy.Mac
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !peer.DisableConsumer {
|
||||||
p.AddConsumer(ctx, f, g())
|
p.AddConsumer(ctx, f, g())
|
||||||
|
}
|
||||||
|
if !peer.DisableProducer {
|
||||||
p.AddProducer(ctx, f, v())
|
p.AddProducer(ctx, f, v())
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -57,6 +57,9 @@ type Peer struct {
|
|||||||
KeepAlive uint
|
KeepAlive uint
|
||||||
Timeout uint
|
Timeout uint
|
||||||
RetryWait uint
|
RetryWait uint
|
||||||
|
|
||||||
|
DisableConsumer bool `validate:"omitempty,nefield=DisableProducer"`
|
||||||
|
DisableProducer bool `validate:"omitempty,nefield=DisableConsumer"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p Peer) GetLocalHost() string {
|
func (p Peer) GetLocalHost() string {
|
||||||
|
Loading…
Reference in New Issue
Block a user