Migrate bad options to library

This commit is contained in:
世界
2024-11-07 21:44:04 +08:00
parent 85f634d0cb
commit 1a230bda5d
58 changed files with 579 additions and 877 deletions

View File

@@ -6,18 +6,20 @@ import (
C "github.com/sagernet/sing-box/constant"
"github.com/sagernet/sing-box/option"
"github.com/sagernet/sing/common"
"github.com/sagernet/sing/common/json/badoption"
)
// Since this is a feature one-off added by outsiders, I won't address these anymore.
func _TestProxyProtocol(t *testing.T) {
startInstance(t, option.Options{
Inbounds: []option.LegacyInbound{
LegacyInbounds: []option.LegacyInbound{
{
Type: C.TypeMixed,
Tag: "mixed-in",
MixedOptions: option.HTTPMixedInboundOptions{
ListenOptions: option.ListenOptions{
Listen: option.NewListenAddress(netip.IPv4Unspecified()),
Listen: common.Ptr(badoption.Addr(netip.IPv4Unspecified())),
ListenPort: clientPort,
},
},
@@ -26,7 +28,7 @@ func _TestProxyProtocol(t *testing.T) {
Type: C.TypeDirect,
DirectOptions: option.DirectInboundOptions{
ListenOptions: option.ListenOptions{
Listen: option.NewListenAddress(netip.IPv4Unspecified()),
Listen: common.Ptr(badoption.Addr(netip.IPv4Unspecified())),
ListenPort: serverPort,
ProxyProtocol: true,
},