mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-26 15:24:44 +00:00
refactor app.Space
This commit is contained in:
1 parent
fcf8a74a3a
commit
2031c13a7f
40 files changed
+484
-477
No files matched your search
@@ -2,6 +2,7 @@ package socks
|
||||
|
||||
import (
|
||||
"github.com/v2ray/v2ray-core/app"
|
||||
"github.com/v2ray/v2ray-core/app/dispatcher"
|
||||
"github.com/v2ray/v2ray-core/proxy"
|
||||
"github.com/v2ray/v2ray-core/proxy/internal"
|
||||
)
|
||||
@@ -9,6 +10,11 @@ import (
|
||||
func init() {
|
||||
internal.MustRegisterInboundHandlerCreator("socks",
|
||||
func(space app.Space, rawConfig interface{}) (proxy.InboundHandler, error) {
|
||||
return NewSocksServer(space, rawConfig.(*Config)), nil
|
||||
if !space.HasApp(dispatcher.APP_ID) {
|
||||
return nil, internal.ErrorBadConfiguration
|
||||
}
|
||||
return NewSocksServer(
|
||||
rawConfig.(*Config),
|
||||
space.GetApp(dispatcher.APP_ID).(dispatcher.PacketDispatcher)), nil
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user