refactor: Modular inbounds/outbounds

This commit is contained in:
世界
2024-11-02 00:39:02 +08:00
parent 9f7683818f
commit e233fd4fe5
152 changed files with 3116 additions and 2926 deletions

View File

@@ -28,7 +28,7 @@ func testHysteria2Self(t *testing.T, salamanderPassword string) {
}
}
startInstance(t, option.Options{
Inbounds: []option.Inbound{
Inbounds: []option.LegacyInbound{
{
Type: C.TypeMixed,
Tag: "mixed-in",
@@ -63,7 +63,7 @@ func testHysteria2Self(t *testing.T, salamanderPassword string) {
},
},
},
Outbounds: []option.Outbound{
LegacyOutbounds: []option.LegacyOutbound{
{
Type: C.TypeDirect,
},
@@ -115,7 +115,7 @@ func testHysteria2Self(t *testing.T, salamanderPassword string) {
func TestHysteria2Inbound(t *testing.T) {
caPem, certPem, keyPem := createSelfSignedCertificate(t, "example.org")
startInstance(t, option.Options{
Inbounds: []option.Inbound{
Inbounds: []option.LegacyInbound{
{
Type: C.TypeHysteria2,
Hysteria2Options: option.Hysteria2InboundOptions{
@@ -167,7 +167,7 @@ func TestHysteria2Outbound(t *testing.T) {
},
})
startInstance(t, option.Options{
Inbounds: []option.Inbound{
Inbounds: []option.LegacyInbound{
{
Type: C.TypeMixed,
MixedOptions: option.HTTPMixedInboundOptions{
@@ -178,7 +178,7 @@ func TestHysteria2Outbound(t *testing.T) {
},
},
},
Outbounds: []option.Outbound{
LegacyOutbounds: []option.LegacyOutbound{
{
Type: C.TypeHysteria2,
Hysteria2Options: option.Hysteria2OutboundOptions{