Alanxtl opened a new issue, #667:
URL: https://github.com/apache/dubbo-go-pixiu/issues/667

   <!-- Please use this template while reporting a bug and provide as much info 
as possible. Not doing so may result in your bug not being addressed in a 
timely manner. Thanks!
   
   -->
   
   
   **What happened**:
   
   If you specify a domain name for the endpoint, it will be ignored. You can 
only specify an IP address. 
   
   In this conf.yaml, the domain I specified in line 57, 
```"api.deepseek.com"``` will be ignored, pixiu will use default ip_address and 
default port as the target endpoint, i.e. ```0.0.0.0:8081```.
   
   ```yaml
   static_resources:
     listeners:
       - name: "llm_proxy"
         protocol_type: "HTTP"
         address:
           socket_address:
             address: "0.0.0.0"
             port: 8888
         filter_chains:
             filters:
               - name: dgp.filter.httpconnectionmanager
                 config:
                   route_config:
                     routes:
                       - match:
                           prefix: "/chat/completions"
                         route:
                           cluster: "chat"
                           cluster_not_found_response_code: 505
                   http_filters:
                     - name: dgp.filter.http.httpproxy
                       config:
                         maxIdleConns: 100
                         maxIdleConnsPerHost: 100
                         MaxConnsPerHost: 100
                     - name: dgp.filter.llm.tokenizer
         config:
           idle_timeout: 5s
           read_timeout: 5s
           write_timeout: 5s
     clusters:
       - name: "chat"
         lb_policy: "lb"
         endpoints:
           - id: 1
             socket_address:
               domains:
                 - "api.deepseek.com"
     shutdown_config:
       timeout: "60s"
       step_timeout: "10s"
       reject_policy: "immediacy"
   ```
   
   For example, in the httpfilter 
```pkg/filter/http/httpproxy/routerfilter.go```, the endpoint address is 
obtained through the ```GetAddress``` function.
   
   ```go
        parsedURL := url.URL{
                Host:     endpoint.Address.GetAddress(),
                Scheme:   "https",
                Path:     r.URL.Path,
                RawQuery: r.URL.RawQuery,
        }
   ```
   
   The source code of ```GetAddress``` in the second line which is:
   
   ```pkg/model/base.go```
   ```go
        SocketAddress struct {
                Address      string   `default:"0.0.0.0" yaml:"address" 
json:"address" mapstructure:"address"`
                Port         int      `default:"8881" yaml:"port" json:"port" 
mapstructure:"port"`
                ResolverName string   `yaml:"resolver_name" 
json:"resolver_name" mapstructure:"resolver_name"`
                Domains      []string `yaml:"domains" json:"domains" 
mapstructure:"domains"`
                CertsDir     string   `yaml:"certs_dir" json:"certs_dir" 
mapstructure:"certs_dir"`
        }
   
   func (a SocketAddress) GetAddress() string {
        return fmt.Sprintf("%s:%v", a.Address, a.Port)
   }
   ```
   
   The code ignores ```domian``` field, which takes default ```Address``` and 
default ```port```
   
   **What you expected to happen**:
   
   The ```domain``` field should not be ignored, in the httpfilter above, 
```parsedURL.host``` should be the domain denoted in conf.yaml instead of the 
default ```Address``` and default ```port```.
   
   **How to reproduce it (as minimally and precisely as possible)**:
   
   **Anything else we need to know?**:
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to