dokodemo_factory.go 564 B

12345678910111213141516171819
  1. package dokodemo
  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/dokodemo/config/json"
  6. )
  7. type DokodemoDoorFactory struct {
  8. }
  9. func (this DokodemoDoorFactory) Create(dispatcher app.PacketDispatcher, rawConfig interface{}) (connhandler.InboundConnectionHandler, error) {
  10. config := rawConfig.(*json.DokodemoConfig)
  11. return NewDokodemoDoor(dispatcher, config), nil
  12. }
  13. func init() {
  14. connhandler.RegisterInboundConnectionHandlerFactory("dokodemo-door", DokodemoDoorFactory{})
  15. }