1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-01-02 23:47:07 -05:00
This commit is contained in:
v2ray 2016-01-25 17:29:26 +01:00
parent 5e16fa2dcd
commit 9ae258de3d
8 changed files with 9 additions and 9 deletions

View File

@ -31,7 +31,7 @@ func (this *BlackHole) Dispatch(firstPacket v2net.Packet, ray ray.OutboundRay) e
} }
func init() { func init() {
internal.MustRegisterOutboundConnectionHandlerCreator("blackhole", internal.MustRegisterOutboundHandlerCreator("blackhole",
func(space app.Space, config interface{}) (proxy.OutboundHandler, error) { func(space app.Space, config interface{}) (proxy.OutboundHandler, error) {
return NewBlackHole(), nil return NewBlackHole(), nil
}) })

View File

@ -7,7 +7,7 @@ import (
) )
func init() { func init() {
internal.MustRegisterInboundConnectionHandlerCreator("dokodemo-door", internal.MustRegisterInboundHandlerCreator("dokodemo-door",
func(space app.Space, rawConfig interface{}) (proxy.InboundHandler, error) { func(space app.Space, rawConfig interface{}) (proxy.InboundHandler, error) {
config := rawConfig.(*Config) config := rawConfig.(*Config)
return NewDokodemoDoor(space, config), nil return NewDokodemoDoor(space, config), nil

View File

@ -7,7 +7,7 @@ import (
) )
func init() { func init() {
internal.MustRegisterOutboundConnectionHandlerCreator("freedom", internal.MustRegisterOutboundHandlerCreator("freedom",
func(space app.Space, config interface{}) (proxy.OutboundHandler, error) { func(space app.Space, config interface{}) (proxy.OutboundHandler, error) {
return &FreedomConnection{space: space}, nil return &FreedomConnection{space: space}, nil
}) })

View File

@ -7,7 +7,7 @@ import (
) )
func init() { func init() {
internal.MustRegisterInboundConnectionHandlerCreator("http", internal.MustRegisterInboundHandlerCreator("http",
func(space app.Space, rawConfig interface{}) (proxy.InboundHandler, error) { func(space app.Space, rawConfig interface{}) (proxy.InboundHandler, error) {
return NewHttpProxyServer(space, rawConfig.(*Config)), nil return NewHttpProxyServer(space, rawConfig.(*Config)), nil
}) })

View File

@ -25,7 +25,7 @@ func RegisterInboundHandlerCreator(name string, creator InboundHandlerCreator) e
return nil return nil
} }
func MustRegisterInboundConnectionHandlerCreator(name string, creator InboundHandlerCreator) { func MustRegisterInboundHandlerCreator(name string, creator InboundHandlerCreator) {
if err := RegisterInboundHandlerCreator(name, creator); err != nil { if err := RegisterInboundHandlerCreator(name, creator); err != nil {
panic(err) panic(err)
} }
@ -39,7 +39,7 @@ func RegisterOutboundHandlerCreator(name string, creator OutboundHandlerCreator)
return nil return nil
} }
func MustRegisterOutboundConnectionHandlerCreator(name string, creator OutboundHandlerCreator) { func MustRegisterOutboundHandlerCreator(name string, creator OutboundHandlerCreator) {
if err := RegisterOutboundHandlerCreator(name, creator); err != nil { if err := RegisterOutboundHandlerCreator(name, creator); err != nil {
panic(err) panic(err)
} }

View File

@ -7,7 +7,7 @@ import (
) )
func init() { func init() {
internal.MustRegisterInboundConnectionHandlerCreator("socks", internal.MustRegisterInboundHandlerCreator("socks",
func(space app.Space, rawConfig interface{}) (proxy.InboundHandler, error) { func(space app.Space, rawConfig interface{}) (proxy.InboundHandler, error) {
return NewSocksServer(space, rawConfig.(*Config)), nil return NewSocksServer(space, rawConfig.(*Config)), nil
}) })

View File

@ -174,7 +174,7 @@ func handleOutput(request *protocol.VMessRequest, writer io.Writer, output <-cha
} }
func init() { func init() {
internal.MustRegisterInboundConnectionHandlerCreator("vmess", internal.MustRegisterInboundHandlerCreator("vmess",
func(space app.Space, rawConfig interface{}) (proxy.InboundHandler, error) { func(space app.Space, rawConfig interface{}) (proxy.InboundHandler, error) {
config := rawConfig.(*Config) config := rawConfig.(*Config)

View File

@ -190,7 +190,7 @@ func (this *VMessOutboundHandler) handleResponse(conn net.Conn, request *protoco
} }
func init() { func init() {
internal.MustRegisterOutboundConnectionHandlerCreator("vmess", internal.MustRegisterOutboundHandlerCreator("vmess",
func(space app.Space, rawConfig interface{}) (proxy.OutboundHandler, error) { func(space app.Space, rawConfig interface{}) (proxy.OutboundHandler, error) {
vOutConfig := rawConfig.(*Config) vOutConfig := rawConfig.(*Config)
return &VMessOutboundHandler{ return &VMessOutboundHandler{