Refactor inbound/outbound options struct

This commit is contained in:
世界
2023-12-11 18:36:06 +08:00
parent 36b0f2e91a
commit 6ddcd3954d
31 changed files with 844 additions and 697 deletions

View File

@@ -68,11 +68,13 @@ func testVMessTransportSelf(t *testing.T, server *option.V2RayTransportOptions,
UUID: user.String(),
},
},
TLS: &option.InboundTLSOptions{
Enabled: true,
ServerName: "example.org",
CertificatePath: certPem,
KeyPath: keyPem,
InboundTLSOptionsContainer: option.InboundTLSOptionsContainer{
TLS: &option.InboundTLSOptions{
Enabled: true,
ServerName: "example.org",
CertificatePath: certPem,
KeyPath: keyPem,
},
},
Transport: server,
},
@@ -92,10 +94,12 @@ func testVMessTransportSelf(t *testing.T, server *option.V2RayTransportOptions,
},
UUID: user.String(),
Security: "zero",
TLS: &option.OutboundTLSOptions{
Enabled: true,
ServerName: "example.org",
CertificatePath: certPem,
OutboundTLSOptionsContainer: option.OutboundTLSOptionsContainer{
TLS: &option.OutboundTLSOptions{
Enabled: true,
ServerName: "example.org",
CertificatePath: certPem,
},
},
Transport: client,
},
@@ -144,11 +148,13 @@ func testTrojanTransportSelf(t *testing.T, server *option.V2RayTransportOptions,
Password: user.String(),
},
},
TLS: &option.InboundTLSOptions{
Enabled: true,
ServerName: "example.org",
CertificatePath: certPem,
KeyPath: keyPem,
InboundTLSOptionsContainer: option.InboundTLSOptionsContainer{
TLS: &option.InboundTLSOptions{
Enabled: true,
ServerName: "example.org",
CertificatePath: certPem,
KeyPath: keyPem,
},
},
Transport: server,
},
@@ -167,10 +173,12 @@ func testTrojanTransportSelf(t *testing.T, server *option.V2RayTransportOptions,
ServerPort: serverPort,
},
Password: user.String(),
TLS: &option.OutboundTLSOptions{
Enabled: true,
ServerName: "example.org",
CertificatePath: certPem,
OutboundTLSOptionsContainer: option.OutboundTLSOptionsContainer{
TLS: &option.OutboundTLSOptions{
Enabled: true,
ServerName: "example.org",
CertificatePath: certPem,
},
},
Transport: client,
},
@@ -222,11 +230,13 @@ func TestVMessQUICSelf(t *testing.T) {
UUID: user.String(),
},
},
TLS: &option.InboundTLSOptions{
Enabled: true,
ServerName: "example.org",
CertificatePath: certPem,
KeyPath: keyPem,
InboundTLSOptionsContainer: option.InboundTLSOptionsContainer{
TLS: &option.InboundTLSOptions{
Enabled: true,
ServerName: "example.org",
CertificatePath: certPem,
KeyPath: keyPem,
},
},
Transport: transport,
},
@@ -246,10 +256,12 @@ func TestVMessQUICSelf(t *testing.T) {
},
UUID: user.String(),
Security: "zero",
TLS: &option.OutboundTLSOptions{
Enabled: true,
ServerName: "example.org",
CertificatePath: certPem,
OutboundTLSOptionsContainer: option.OutboundTLSOptionsContainer{
TLS: &option.OutboundTLSOptions{
Enabled: true,
ServerName: "example.org",
CertificatePath: certPem,
},
},
Transport: transport,
},