mirror of
https://github.com/e1732a364fed/v2ray_simple.git
synced 2025-12-24 13:27:56 +08:00
移除 ClientCreator.UseUDPAsMsgConn 方法
This commit is contained in:
8
main.go
8
main.go
@@ -1200,12 +1200,12 @@ func dialClient(iics incomingInserverConnState, targetAddr netLayer.Addr,
|
||||
realTargetAddr.Network = targetAddr.Network
|
||||
}
|
||||
|
||||
dialhere := !(realTargetAddr.Network == "udp" && client.GetCreator().UseUDPAsMsgConn())
|
||||
dialhere := !(client.Name() == proxy.DirectName)
|
||||
|
||||
/*
|
||||
direct和shadowsocks的udp是自己拨号的,因为它用到了udp的包特性
|
||||
direct的udp是自己拨号的,因为它用到了udp的fullcone
|
||||
|
||||
不是上面情况的话,也要分情况:
|
||||
不是的话,也要分情况:
|
||||
如果是单路的, 则我们在此dial, 如果是多路复用, 则不行, 因为要复用同一个连接
|
||||
Instead, 我们要试图 取出已经拨号好了的 连接
|
||||
*/
|
||||
@@ -1251,8 +1251,6 @@ func dialClient(iics incomingInserverConnState, targetAddr netLayer.Addr,
|
||||
na = client.LocalTCPAddr()
|
||||
case "udp":
|
||||
na = client.LocalUDPAddr()
|
||||
case netLayer.DualNetworkName:
|
||||
realTargetAddr.Network = targetAddr.Network
|
||||
}
|
||||
|
||||
clientConn, err = realTargetAddr.Dial(client.GetSockopt(), na)
|
||||
|
||||
@@ -61,8 +61,6 @@ type ClientCreator interface {
|
||||
URLToDialConf(url *url.URL, iv *DialConf, format int) (*DialConf, error)
|
||||
//DialConfToURL(url *DialConf, format int) (*url.URL, error)
|
||||
|
||||
UseUDPAsMsgConn() bool //默认情况下,UDP会被包装成流式协议,除非指出需要利用udp的固定包长度特性; direct 和 shadowsocks会返回true.
|
||||
|
||||
}
|
||||
|
||||
// 可通过标准配置或url 来初始化。
|
||||
|
||||
@@ -18,10 +18,6 @@ const (
|
||||
// implements ClientCreator for direct
|
||||
type DirectCreator struct{ CreatorCommonStruct }
|
||||
|
||||
func (DirectCreator) UseUDPAsMsgConn() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// true
|
||||
func (DirectCreator) MultiTransportLayer() bool {
|
||||
return true
|
||||
|
||||
@@ -58,9 +58,6 @@ func tryRejectWithHttpRespAndClose(rejectType string, underlay net.Conn) {
|
||||
// implements ClientCreator and ServerCreator for reject
|
||||
type RejectCreator struct{ CreatorCommonStruct }
|
||||
|
||||
func (RejectCreator) UseUDPAsMsgConn() bool {
|
||||
return false
|
||||
}
|
||||
func (RejectCreator) NewClient(dc *DialConf) (Client, error) {
|
||||
r := &RejectClient{}
|
||||
|
||||
|
||||
@@ -17,9 +17,6 @@ func init() {
|
||||
|
||||
type ClientCreator struct{ proxy.CreatorCommonStruct }
|
||||
|
||||
func (ClientCreator) UseUDPAsMsgConn() bool {
|
||||
return false
|
||||
}
|
||||
func (ClientCreator) MultiTransportLayer() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -18,10 +18,6 @@ func init() {
|
||||
|
||||
type ClientCreator struct{ proxy.CreatorCommonStruct }
|
||||
|
||||
func (ClientCreator) UseUDPAsMsgConn() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (ClientCreator) URLToDialConf(u *url.URL, dc *proxy.DialConf, format int) (*proxy.DialConf, error) {
|
||||
if dc == nil {
|
||||
dc = &proxy.DialConf{}
|
||||
|
||||
@@ -17,10 +17,6 @@ func init() {
|
||||
|
||||
type ClientCreator struct{ proxy.CreatorCommonStruct }
|
||||
|
||||
func (ClientCreator) UseUDPAsMsgConn() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// true
|
||||
func (ClientCreator) MultiTransportLayer() bool {
|
||||
return true
|
||||
|
||||
@@ -20,10 +20,6 @@ func init() {
|
||||
|
||||
type ClientCreator struct{ proxy.CreatorCommonStruct }
|
||||
|
||||
func (ClientCreator) UseUDPAsMsgConn() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (ClientCreator) URLToDialConf(url *url.URL, dc *proxy.DialConf, format int) (*proxy.DialConf, error) {
|
||||
switch format {
|
||||
case proxy.UrlStandardFormat:
|
||||
|
||||
@@ -18,10 +18,6 @@ func init() {
|
||||
|
||||
type ClientCreator struct{ proxy.CreatorCommonStruct }
|
||||
|
||||
func (ClientCreator) UseUDPAsMsgConn() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (ClientCreator) NewClient(dc *proxy.DialConf) (proxy.Client, error) {
|
||||
|
||||
uuidStr := dc.Uuid
|
||||
|
||||
@@ -49,10 +49,6 @@ func GetEncryptAlgo(dc *proxy.DialConf) (result string) {
|
||||
|
||||
type ClientCreator struct{ proxy.CreatorCommonStruct }
|
||||
|
||||
func (ClientCreator) UseUDPAsMsgConn() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (ClientCreator) URLToDialConf(url *url.URL, dc *proxy.DialConf, format int) (*proxy.DialConf, error) {
|
||||
if format != proxy.UrlStandardFormat {
|
||||
return dc, utils.ErrUnImplemented
|
||||
|
||||
Reference in New Issue
Block a user