socksfactory.go 420 B

123456789101112131415
  1. package socks
  2. import (
  3. "github.com/v2ray/v2ray-core/app"
  4. "github.com/v2ray/v2ray-core/proxy"
  5. "github.com/v2ray/v2ray-core/proxy/common/connhandler"
  6. )
  7. func init() {
  8. if err := proxy.RegisterInboundConnectionHandlerFactory("socks", func(space app.Space, rawConfig interface{}) (connhandler.InboundConnectionHandler, error) {
  9. return NewSocksServer(space, rawConfig.(Config)), nil
  10. }); err != nil {
  11. panic(err)
  12. }
  13. }