|
@@ -22,8 +22,8 @@ func TestInterfaces(t *testing.T) {
|
|
|
_ = (outbound.Manager)(new(Manager))
|
|
_ = (outbound.Manager)(new(Manager))
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//go:linkname mustToContextForced github.com/v2fly/v2ray-core/v4.mustToContext
|
|
|
|
|
-func mustToContextForced(ctx context.Context, v *core.Instance) context.Context
|
|
|
|
|
|
|
+//go:linkname toContext github.com/v2fly/v2ray-core/v4.toContext
|
|
|
|
|
+func toContext(ctx context.Context, v *core.Instance) context.Context
|
|
|
|
|
|
|
|
func TestOutboundWithoutStatCounter(t *testing.T) {
|
|
func TestOutboundWithoutStatCounter(t *testing.T) {
|
|
|
config := &core.Config{
|
|
config := &core.Config{
|
|
@@ -41,7 +41,7 @@ func TestOutboundWithoutStatCounter(t *testing.T) {
|
|
|
|
|
|
|
|
v, _ := core.New(config)
|
|
v, _ := core.New(config)
|
|
|
v.AddFeature((outbound.Manager)(new(Manager)))
|
|
v.AddFeature((outbound.Manager)(new(Manager)))
|
|
|
- ctx := mustToContextForced(context.Background(), v)
|
|
|
|
|
|
|
+ ctx := toContext(context.Background(), v)
|
|
|
h, _ := NewHandler(ctx, &core.OutboundHandlerConfig{
|
|
h, _ := NewHandler(ctx, &core.OutboundHandlerConfig{
|
|
|
Tag: "tag",
|
|
Tag: "tag",
|
|
|
ProxySettings: serial.ToTypedMessage(&freedom.Config{}),
|
|
ProxySettings: serial.ToTypedMessage(&freedom.Config{}),
|
|
@@ -70,7 +70,7 @@ func TestOutboundWithStatCounter(t *testing.T) {
|
|
|
|
|
|
|
|
v, _ := core.New(config)
|
|
v, _ := core.New(config)
|
|
|
v.AddFeature((outbound.Manager)(new(Manager)))
|
|
v.AddFeature((outbound.Manager)(new(Manager)))
|
|
|
- ctx := mustToContextForced(context.Background(), v)
|
|
|
|
|
|
|
+ ctx := toContext(context.Background(), v)
|
|
|
h, _ := NewHandler(ctx, &core.OutboundHandlerConfig{
|
|
h, _ := NewHandler(ctx, &core.OutboundHandlerConfig{
|
|
|
Tag: "tag",
|
|
Tag: "tag",
|
|
|
ProxySettings: serial.ToTypedMessage(&freedom.Config{}),
|
|
ProxySettings: serial.ToTypedMessage(&freedom.Config{}),
|