mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-05-17 17:48:40 +00:00
Write a test covering both methods and ignore commander when listing outbounds.
This commit is contained in:
parent
1f014eb655
commit
3af7a19c06
2 changed files with 104 additions and 0 deletions
|
@ -3,6 +3,7 @@ package command
|
|||
import (
|
||||
"context"
|
||||
|
||||
"github.com/xtls/xray-core/app/commander"
|
||||
"github.com/xtls/xray-core/common"
|
||||
"github.com/xtls/xray-core/common/errors"
|
||||
"github.com/xtls/xray-core/common/protocol"
|
||||
|
@ -181,6 +182,10 @@ func (s *handlerServer) ListOutbounds(ctx context.Context, request *ListOutbound
|
|||
handlers := s.ohm.ListHandlers(ctx)
|
||||
response := &ListOutboundsResponse{}
|
||||
for _, handler := range handlers {
|
||||
// Ignore gRPC outbound
|
||||
if _, ok := handler.(*commander.Outbound); ok {
|
||||
continue
|
||||
}
|
||||
response.Outbounds = append(response.Outbounds, &core.OutboundHandlerConfig{
|
||||
Tag: handler.Tag(),
|
||||
SenderSettings: handler.SenderSettings(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue