http_factory.go 452 B

1234567891011121314151617
  1. package http
  2. import (
  3. "github.com/v2ray/v2ray-core/app"
  4. "github.com/v2ray/v2ray-core/proxy/common/connhandler"
  5. )
  6. type HttpProxyServerFactory struct {
  7. }
  8. func (this HttpProxyServerFactory) Create(space app.Space, rawConfig interface{}) (connhandler.InboundConnectionHandler, error) {
  9. return NewHttpProxyServer(space, rawConfig.(Config)), nil
  10. }
  11. func init() {
  12. connhandler.RegisterInboundConnectionHandlerFactory("http", HttpProxyServerFactory{})
  13. }