mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-20 00:07:06 -05:00
rename NewDokodemoDoor
This commit is contained in:
parent
195594bed0
commit
88b607d31b
@ -31,7 +31,7 @@ type DokodemoDoor struct {
|
|||||||
meta *proxy.InboundHandlerMeta
|
meta *proxy.InboundHandlerMeta
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewDokodemoDoor(ctx context.Context, config *Config) (*DokodemoDoor, error) {
|
func New(ctx context.Context, config *Config) (*DokodemoDoor, error) {
|
||||||
space := app.SpaceFromContext(ctx)
|
space := app.SpaceFromContext(ctx)
|
||||||
if space == nil {
|
if space == nil {
|
||||||
return nil, errors.New("Dokodemo: No space in context.")
|
return nil, errors.New("Dokodemo: No space in context.")
|
||||||
@ -215,6 +215,6 @@ func (v *DokodemoDoor) HandleTCPConnection(conn internet.Connection) {
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
common.Must(common.RegisterConfig((*Config)(nil), func(ctx context.Context, config interface{}) (interface{}, error) {
|
common.Must(common.RegisterConfig((*Config)(nil), func(ctx context.Context, config interface{}) (interface{}, error) {
|
||||||
return NewDokodemoDoor(ctx, config.(*Config))
|
return New(ctx, config.(*Config))
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ func TestDokodemoTCP(t *testing.T) {
|
|||||||
Protocol: internet.TransportProtocol_TCP,
|
Protocol: internet.TransportProtocol_TCP,
|
||||||
}})
|
}})
|
||||||
|
|
||||||
dokodemo, err := NewDokodemoDoor(ctx, &Config{
|
dokodemo, err := New(ctx, &Config{
|
||||||
Address: v2net.NewIPOrDomain(v2net.LocalHostIP),
|
Address: v2net.NewIPOrDomain(v2net.LocalHostIP),
|
||||||
Port: uint32(tcpServer.Port),
|
Port: uint32(tcpServer.Port),
|
||||||
NetworkList: v2net.Network_TCP.AsList(),
|
NetworkList: v2net.Network_TCP.AsList(),
|
||||||
@ -140,7 +140,7 @@ func TestDokodemoUDP(t *testing.T) {
|
|||||||
Protocol: internet.TransportProtocol_TCP,
|
Protocol: internet.TransportProtocol_TCP,
|
||||||
}})
|
}})
|
||||||
|
|
||||||
dokodemo, err := NewDokodemoDoor(ctx, &Config{
|
dokodemo, err := New(ctx, &Config{
|
||||||
Address: v2net.NewIPOrDomain(v2net.LocalHostIP),
|
Address: v2net.NewIPOrDomain(v2net.LocalHostIP),
|
||||||
Port: uint32(udpServer.Port),
|
Port: uint32(udpServer.Port),
|
||||||
NetworkList: v2net.Network_UDP.AsList(),
|
NetworkList: v2net.Network_UDP.AsList(),
|
||||||
|
Loading…
Reference in New Issue
Block a user