socksfactory.go 525 B

123456789101112131415161718
  1. package socks
  2. import (
  3. "github.com/v2ray/v2ray-core/app"
  4. "github.com/v2ray/v2ray-core/proxy/common/connhandler"
  5. "github.com/v2ray/v2ray-core/proxy/socks/config/json"
  6. )
  7. type SocksServerFactory struct {
  8. }
  9. func (this SocksServerFactory) Create(dispatcher app.PacketDispatcher, rawConfig interface{}) (connhandler.InboundConnectionHandler, error) {
  10. return NewSocksServer(dispatcher, rawConfig.(*json.SocksConfig)), nil
  11. }
  12. func init() {
  13. connhandler.RegisterInboundConnectionHandlerFactory("socks", SocksServerFactory{})
  14. }