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