socksfactory.go 423 B

1234567891011121314151617
  1. package socks
  2. import (
  3. "github.com/v2ray/v2ray-core"
  4. "github.com/v2ray/v2ray-core/proxy/socks/config/json"
  5. )
  6. type SocksServerFactory struct {
  7. }
  8. func (factory SocksServerFactory) Create(vp *core.Point, config interface{}) (core.InboundConnectionHandler, error) {
  9. return NewSocksServer(vp, config.(*json.SocksConfig)), nil
  10. }
  11. func init() {
  12. core.RegisterInboundConnectionHandlerFactory("socks", SocksServerFactory{})
  13. }