mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-17 22:57:10 +00:00
Move connection handler interfaces to proxy/common/connhandler
This commit is contained in:
1 parent
361a22d74d
commit
f93b29993b
14 files changed
+40
-40
No files matched your search
@@ -2,19 +2,19 @@ package socks
|
||||
|
||||
import (
|
||||
"github.com/v2ray/v2ray-core/app"
|
||||
"github.com/v2ray/v2ray-core/proxy"
|
||||
"github.com/v2ray/v2ray-core/proxy/common/connhandler"
|
||||
"github.com/v2ray/v2ray-core/proxy/socks/config/json"
|
||||
)
|
||||
|
||||
type SocksServerFactory struct {
|
||||
}
|
||||
|
||||
func (factory SocksServerFactory) Create(dispatcher app.PacketDispatcher, rawConfig interface{}) (proxy.InboundConnectionHandler, error) {
|
||||
func (factory SocksServerFactory) Create(dispatcher app.PacketDispatcher, rawConfig interface{}) (connhandler.InboundConnectionHandler, error) {
|
||||
config := rawConfig.(*json.SocksConfig)
|
||||
config.Initialize()
|
||||
return NewSocksServer(dispatcher, config), nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
proxy.RegisterInboundConnectionHandlerFactory("socks", SocksServerFactory{})
|
||||
connhandler.RegisterInboundConnectionHandlerFactory("socks", SocksServerFactory{})
|
||||
}
|
||||
Reference in new issue
Block a user