mirror of
https://github.com/daeuniverse/dae.git
synced 2025-07-09 07:19:17 +07:00
* fix: bad ipversion selection caused by #251 * chore: upgrade softwind
This commit is contained in:
@ -16,7 +16,7 @@ import (
|
||||
|
||||
"github.com/daeuniverse/dae/common/consts"
|
||||
"github.com/daeuniverse/dae/common/netutils"
|
||||
"github.com/mzz2017/softwind/protocol/direct"
|
||||
"github.com/daeuniverse/softwind/protocol/direct"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -13,7 +13,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/daeuniverse/dae/common/consts"
|
||||
"github.com/mzz2017/softwind/pkg/fastrand"
|
||||
"github.com/daeuniverse/softwind/pkg/fastrand"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
|
@ -9,7 +9,7 @@ import (
|
||||
"fmt"
|
||||
"net"
|
||||
|
||||
"github.com/mzz2017/softwind/netproxy"
|
||||
"github.com/daeuniverse/softwind/netproxy"
|
||||
)
|
||||
|
||||
type blockDialer struct {
|
||||
|
@ -25,10 +25,10 @@ import (
|
||||
|
||||
"github.com/daeuniverse/dae/common/consts"
|
||||
"github.com/daeuniverse/dae/common/netutils"
|
||||
"github.com/daeuniverse/softwind/netproxy"
|
||||
"github.com/daeuniverse/softwind/pkg/fastrand"
|
||||
"github.com/daeuniverse/softwind/protocol/direct"
|
||||
dnsmessage "github.com/miekg/dns"
|
||||
"github.com/mzz2017/softwind/netproxy"
|
||||
"github.com/mzz2017/softwind/pkg/fastrand"
|
||||
"github.com/mzz2017/softwind/protocol/direct"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
@ -96,6 +96,13 @@ func (d *Dialer) mustGetCollection(typ *NetworkType) *collection {
|
||||
return d.collections[5]
|
||||
}
|
||||
case consts.L4ProtoStr_UDP:
|
||||
// UDP share the DNS check result.
|
||||
switch typ.IpVersion {
|
||||
case consts.IpVersionStr_4:
|
||||
return d.collections[2]
|
||||
case consts.IpVersionStr_6:
|
||||
return d.collections[3]
|
||||
}
|
||||
}
|
||||
}
|
||||
panic("invalid param")
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/mzz2017/softwind/netproxy"
|
||||
"github.com/daeuniverse/softwind/netproxy"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
package dialer
|
||||
|
||||
import (
|
||||
"github.com/mzz2017/softwind/netproxy"
|
||||
softwindDirect "github.com/mzz2017/softwind/protocol/direct"
|
||||
"github.com/daeuniverse/softwind/netproxy"
|
||||
softwindDirect "github.com/daeuniverse/softwind/protocol/direct"
|
||||
)
|
||||
|
||||
func NewDirectDialer(option *GlobalOption, fullcone bool) (netproxy.Dialer, *Property) {
|
||||
|
@ -8,8 +8,8 @@ import (
|
||||
|
||||
"github.com/daeuniverse/dae/common"
|
||||
"github.com/daeuniverse/dae/component/outbound/dialer"
|
||||
"github.com/mzz2017/softwind/netproxy"
|
||||
"github.com/mzz2017/softwind/protocol/http"
|
||||
"github.com/daeuniverse/softwind/netproxy"
|
||||
"github.com/daeuniverse/softwind/protocol/http"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -12,8 +12,8 @@ import (
|
||||
|
||||
"github.com/daeuniverse/dae/common"
|
||||
"github.com/daeuniverse/dae/component/outbound/dialer"
|
||||
"github.com/mzz2017/softwind/netproxy"
|
||||
"github.com/mzz2017/softwind/protocol"
|
||||
"github.com/daeuniverse/softwind/netproxy"
|
||||
"github.com/daeuniverse/softwind/protocol"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -11,8 +11,8 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/daeuniverse/dae/common"
|
||||
"github.com/mzz2017/softwind/netproxy"
|
||||
"github.com/mzz2017/softwind/protocol/direct"
|
||||
"github.com/daeuniverse/softwind/netproxy"
|
||||
"github.com/daeuniverse/softwind/protocol/direct"
|
||||
)
|
||||
|
||||
type FromLinkCreator func(gOption *GlobalOption, nextDialer netproxy.Dialer, link string) (dialer netproxy.Dialer, property *Property, err error)
|
||||
|
@ -11,9 +11,9 @@ import (
|
||||
"github.com/daeuniverse/dae/common"
|
||||
"github.com/daeuniverse/dae/component/outbound/dialer"
|
||||
"github.com/daeuniverse/dae/component/outbound/transport/simpleobfs"
|
||||
"github.com/mzz2017/softwind/netproxy"
|
||||
"github.com/mzz2017/softwind/protocol"
|
||||
"github.com/mzz2017/softwind/protocol/shadowsocks"
|
||||
"github.com/daeuniverse/softwind/netproxy"
|
||||
"github.com/daeuniverse/softwind/protocol"
|
||||
"github.com/daeuniverse/softwind/protocol/shadowsocks"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -10,11 +10,11 @@ import (
|
||||
|
||||
"github.com/daeuniverse/dae/common"
|
||||
"github.com/daeuniverse/dae/component/outbound/dialer"
|
||||
"github.com/mzz2017/softwind/netproxy"
|
||||
"github.com/mzz2017/softwind/protocol"
|
||||
"github.com/mzz2017/softwind/protocol/shadowsocks_stream"
|
||||
"github.com/mzz2017/softwind/transport/shadowsocksr/obfs"
|
||||
"github.com/mzz2017/softwind/transport/shadowsocksr/proto"
|
||||
"github.com/daeuniverse/softwind/netproxy"
|
||||
"github.com/daeuniverse/softwind/protocol"
|
||||
"github.com/daeuniverse/softwind/protocol/shadowsocks_stream"
|
||||
"github.com/daeuniverse/softwind/transport/shadowsocksr/obfs"
|
||||
"github.com/daeuniverse/softwind/transport/shadowsocksr/proto"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -8,8 +8,8 @@ import (
|
||||
"strconv"
|
||||
|
||||
"github.com/daeuniverse/dae/component/outbound/dialer"
|
||||
"github.com/mzz2017/softwind/netproxy"
|
||||
"github.com/mzz2017/softwind/protocol/socks5"
|
||||
"github.com/daeuniverse/softwind/netproxy"
|
||||
"github.com/daeuniverse/softwind/protocol/socks5"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -13,8 +13,8 @@ import (
|
||||
|
||||
"github.com/daeuniverse/dae/common/netutils"
|
||||
"github.com/daeuniverse/dae/component/outbound/dialer"
|
||||
"github.com/daeuniverse/softwind/protocol/direct"
|
||||
dnsmessage "github.com/miekg/dns"
|
||||
"github.com/mzz2017/softwind/protocol/direct"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
|
@ -12,9 +12,9 @@ import (
|
||||
"github.com/daeuniverse/dae/common"
|
||||
"github.com/daeuniverse/dae/component/outbound/dialer"
|
||||
"github.com/daeuniverse/dae/component/outbound/transport/ws"
|
||||
"github.com/mzz2017/softwind/netproxy"
|
||||
"github.com/mzz2017/softwind/protocol"
|
||||
"github.com/mzz2017/softwind/transport/grpc"
|
||||
"github.com/daeuniverse/softwind/netproxy"
|
||||
"github.com/daeuniverse/softwind/protocol"
|
||||
"github.com/daeuniverse/softwind/transport/grpc"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -10,8 +10,8 @@ import (
|
||||
|
||||
"github.com/daeuniverse/dae/common"
|
||||
"github.com/daeuniverse/dae/component/outbound/dialer"
|
||||
"github.com/mzz2017/softwind/netproxy"
|
||||
"github.com/mzz2017/softwind/protocol"
|
||||
"github.com/daeuniverse/softwind/netproxy"
|
||||
"github.com/daeuniverse/softwind/protocol"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -12,12 +12,12 @@ import (
|
||||
"github.com/daeuniverse/dae/component/outbound/dialer"
|
||||
"github.com/daeuniverse/dae/component/outbound/transport/tls"
|
||||
"github.com/daeuniverse/dae/component/outbound/transport/ws"
|
||||
"github.com/daeuniverse/softwind/netproxy"
|
||||
"github.com/daeuniverse/softwind/protocol"
|
||||
"github.com/daeuniverse/softwind/protocol/direct"
|
||||
"github.com/daeuniverse/softwind/protocol/http"
|
||||
"github.com/daeuniverse/softwind/transport/grpc"
|
||||
jsoniter "github.com/json-iterator/go"
|
||||
"github.com/mzz2017/softwind/netproxy"
|
||||
"github.com/mzz2017/softwind/protocol"
|
||||
"github.com/mzz2017/softwind/protocol/direct"
|
||||
"github.com/mzz2017/softwind/protocol/http"
|
||||
"github.com/mzz2017/softwind/transport/grpc"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -12,7 +12,7 @@ import (
|
||||
|
||||
"github.com/daeuniverse/dae/common/consts"
|
||||
"github.com/daeuniverse/dae/component/outbound/dialer"
|
||||
"github.com/mzz2017/softwind/netproxy"
|
||||
"github.com/daeuniverse/softwind/netproxy"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
@ -210,6 +210,13 @@ func (d *DialerGroup) MustGetAliveDialerSet(typ *dialer.NetworkType) *dialer.Ali
|
||||
return d.aliveDialerSets[5]
|
||||
}
|
||||
case consts.L4ProtoStr_UDP:
|
||||
// UDP share the DNS check result.
|
||||
switch typ.IpVersion {
|
||||
case consts.IpVersionStr_4:
|
||||
return d.aliveDialerSets[2]
|
||||
case consts.IpVersionStr_6:
|
||||
return d.aliveDialerSets[3]
|
||||
}
|
||||
}
|
||||
}
|
||||
panic("invalid param")
|
||||
@ -228,10 +235,13 @@ func (g *DialerGroup) Select(networkType *dialer.NetworkType, strictIpVersion bo
|
||||
}
|
||||
if errors.Is(err, NoAliveDialerError) && len(g.Dialers) == 1 {
|
||||
// There is only one dialer in this group. Just choose it instead of return error.
|
||||
return g._select(networkType, &DialerSelectionPolicy{
|
||||
if d, _, err = g._select(networkType, &DialerSelectionPolicy{
|
||||
Policy: consts.DialerSelectionPolicy_Fixed,
|
||||
FixedIndex: 0,
|
||||
})
|
||||
}); err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
return d, dialer.Timeout, nil
|
||||
}
|
||||
return nil, latency, err
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ import (
|
||||
"github.com/daeuniverse/dae/common/consts"
|
||||
"github.com/daeuniverse/dae/component/outbound/dialer"
|
||||
"github.com/daeuniverse/dae/pkg/logger"
|
||||
"github.com/mzz2017/softwind/pkg/fastrand"
|
||||
"github.com/daeuniverse/softwind/pkg/fastrand"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -17,10 +17,10 @@ import (
|
||||
_ "github.com/daeuniverse/dae/component/outbound/transport/simpleobfs"
|
||||
_ "github.com/daeuniverse/dae/component/outbound/transport/tls"
|
||||
_ "github.com/daeuniverse/dae/component/outbound/transport/ws"
|
||||
_ "github.com/mzz2017/softwind/protocol/juicity"
|
||||
_ "github.com/mzz2017/softwind/protocol/shadowsocks"
|
||||
_ "github.com/mzz2017/softwind/protocol/trojanc"
|
||||
_ "github.com/mzz2017/softwind/protocol/tuic"
|
||||
_ "github.com/mzz2017/softwind/protocol/vless"
|
||||
_ "github.com/mzz2017/softwind/protocol/vmess"
|
||||
_ "github.com/daeuniverse/softwind/protocol/juicity"
|
||||
_ "github.com/daeuniverse/softwind/protocol/shadowsocks"
|
||||
_ "github.com/daeuniverse/softwind/protocol/trojanc"
|
||||
_ "github.com/daeuniverse/softwind/protocol/tuic"
|
||||
_ "github.com/daeuniverse/softwind/protocol/vless"
|
||||
_ "github.com/daeuniverse/softwind/protocol/vmess"
|
||||
)
|
||||
|
@ -6,9 +6,9 @@ import (
|
||||
"bytes"
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
"github.com/mzz2017/softwind/netproxy"
|
||||
"github.com/mzz2017/softwind/pkg/fastrand"
|
||||
"github.com/mzz2017/softwind/pool"
|
||||
"github.com/daeuniverse/softwind/netproxy"
|
||||
"github.com/daeuniverse/softwind/pkg/fastrand"
|
||||
"github.com/daeuniverse/softwind/pool"
|
||||
"io"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
@ -7,7 +7,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/daeuniverse/dae/component/outbound/dialer"
|
||||
"github.com/mzz2017/softwind/netproxy"
|
||||
"github.com/daeuniverse/softwind/netproxy"
|
||||
)
|
||||
|
||||
type ObfsType int
|
||||
|
@ -5,8 +5,8 @@ package simpleobfs
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"github.com/mzz2017/softwind/netproxy"
|
||||
"github.com/mzz2017/softwind/pkg/fastrand"
|
||||
"github.com/daeuniverse/softwind/netproxy"
|
||||
"github.com/daeuniverse/softwind/pkg/fastrand"
|
||||
"io"
|
||||
"sync"
|
||||
"time"
|
||||
|
@ -8,7 +8,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/daeuniverse/dae/component/outbound/dialer"
|
||||
"github.com/mzz2017/softwind/netproxy"
|
||||
"github.com/daeuniverse/softwind/netproxy"
|
||||
utls "github.com/refraction-networking/utls"
|
||||
)
|
||||
|
||||
|
@ -10,8 +10,8 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/daeuniverse/dae/component/outbound/dialer"
|
||||
"github.com/daeuniverse/softwind/netproxy"
|
||||
"github.com/gorilla/websocket"
|
||||
"github.com/mzz2017/softwind/netproxy"
|
||||
)
|
||||
|
||||
// Ws is a base Ws struct
|
||||
|
@ -11,7 +11,7 @@ import (
|
||||
"crypto/sha256"
|
||||
"encoding/binary"
|
||||
"github.com/daeuniverse/dae/common"
|
||||
"github.com/mzz2017/softwind/pool"
|
||||
"github.com/daeuniverse/softwind/pool"
|
||||
"golang.org/x/crypto/hkdf"
|
||||
"io"
|
||||
)
|
||||
|
@ -4,7 +4,7 @@ package quicutils
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"github.com/mzz2017/softwind/pool"
|
||||
"github.com/daeuniverse/softwind/pool"
|
||||
"golang.org/x/crypto/hkdf"
|
||||
"hash"
|
||||
"io"
|
||||
|
@ -7,7 +7,7 @@ package quicutils
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/mzz2017/softwind/pool"
|
||||
"github.com/daeuniverse/softwind/pool"
|
||||
"io/fs"
|
||||
"sort"
|
||||
)
|
||||
|
@ -10,7 +10,7 @@ import (
|
||||
"io/fs"
|
||||
|
||||
"github.com/daeuniverse/dae/component/sniffing/internal/quicutils"
|
||||
"github.com/mzz2017/softwind/pool"
|
||||
"github.com/daeuniverse/softwind/pool"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -10,7 +10,7 @@ import (
|
||||
"github.com/daeuniverse/dae/common"
|
||||
"testing"
|
||||
|
||||
"github.com/mzz2017/softwind/pkg/fastrand"
|
||||
"github.com/daeuniverse/softwind/pkg/fastrand"
|
||||
)
|
||||
|
||||
var (
|
||||
|
Reference in New Issue
Block a user