Merge pull request #826 from GLYASAI/V5.2

add ProxyStreamResponses
This commit is contained in:
barnettZQG 2020-08-17 05:11:45 -05:00 committed by GitHub
commit 31ded52290
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -33,7 +33,14 @@ type Server struct {
Locations []*Location
OptionValue map[string]string
UpstreamName string //used for tcp and udp server
ProxyStreamTimeout string
// Sets the number of datagrams expected from the proxied server in response
// to the client request if the UDP protocol is used.
// http://nginx.org/en/docs/stream/ngx_stream_proxy_module.html#proxy_responses
// Default: 1
ProxyStreamResponses int
ProxyStreamTimeout string
//proxy protocol for tcp real ip
ProxyProtocol ProxyProtocol
}

View File

@ -243,7 +243,8 @@ func (o *OrService) getNgxServer(conf *v1.Config) (l7srv []*model.Server, l4srv
"tenant_id": vs.Namespace,
"service_id": vs.ServiceID,
},
UpstreamName: vs.PoolName,
UpstreamName: vs.PoolName,
ProxyStreamResponses: 1,
}
server.Listen = strings.Join(vs.Listening, " ")
l4srv = append(l4srv, server)