You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "ShawnHXH (via GitHub)" <gi...@apache.org> on 2023/03/19 06:53:44 UTC
[GitHub] [dubbo-go-pixiu] ShawnHXH commented on a diff in pull request #548: Fix triple proxy problems
ShawnHXH commented on code in PR #548:
URL: https://github.com/apache/dubbo-go-pixiu/pull/548#discussion_r1141271333
##########
pixiu/pkg/client/triple/triple.go:
##########
@@ -68,40 +76,47 @@ func (tc *Client) MapParams(req *client.Request) (reqData interface{}, err error
}
// Close clear GenericServicePool.
-func (dc *Client) Close() error {
+func (tc *Client) Close() error {
return nil
}
// SingletonTripleClient singleton dubbo clent
-func SingletonTripleClient() *Client {
- return NewTripleClient()
+func SingletonTripleClient(protoset []string) *Client {
+ return NewTripleClient(protoset)
}
// Call invoke service
-func (dc *Client) Call(req *client.Request) (res interface{}, err error) {
+func (tc *Client) Call(req *client.Request) (res interface{}, err error) {
address := strings.Split(req.API.IntegrationRequest.HTTPBackendConfig.URL, ":")
- p := proxy.NewProxy()
+ p := proxy.NewProxy(tc.protosetSource)
targetURL := &url.URL{
Scheme: address[0],
Opaque: address[1],
}
if err := p.Connect(context.Background(), targetURL); err != nil {
return "", errors.Errorf("connect triple server error = %s", err)
}
+
+ header := tc.forwardHeaders(req.IngressRequest.Header)
+ ctx := metadata.NewOutgoingContext(context.Background(), header)
meta := make(map[string][]string)
reqData, _ := io.ReadAll(req.IngressRequest.Body)
Review Comment:
fixed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org