mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-06-12 22:38:41 +00:00
Write server functionality for listing inbound and outbound tags.
This commit is contained in:
parent
72170d8b6b
commit
7cb8cfb9eb
8 changed files with 661 additions and 278 deletions
app/proxyman/inbound
|
@ -89,6 +89,21 @@ func (m *Manager) RemoveHandler(ctx context.Context, tag string) error {
|
|||
return common.ErrNoClue
|
||||
}
|
||||
|
||||
// ListHandlers implements inbound.Manager.
|
||||
func (m *Manager) ListHandlers(ctx context.Context) []inbound.Handler {
|
||||
m.access.RLock()
|
||||
defer m.access.RUnlock()
|
||||
|
||||
var response []inbound.Handler
|
||||
copy(m.untaggedHandler, response)
|
||||
|
||||
for _, v := range m.taggedHandlers {
|
||||
response = append(response, v)
|
||||
}
|
||||
|
||||
return response
|
||||
}
|
||||
|
||||
// Start implements common.Runnable.
|
||||
func (m *Manager) Start() error {
|
||||
m.access.Lock()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue