forked from XTLS/Xray-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add udp over tcp support for shadowsocks-2022
- Loading branch information
1 parent
6f93ef7
commit c350563
Showing
14 changed files
with
119 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
//go:build go1.18 | ||
|
||
package outbound | ||
|
||
import ( | ||
"context" | ||
"os" | ||
|
||
"github.com/sagernet/sing/common/uot" | ||
"github.com/xtls/xray-core/common/net" | ||
"github.com/xtls/xray-core/transport/internet" | ||
"github.com/xtls/xray-core/transport/internet/stat" | ||
) | ||
|
||
func (h *Handler) getUoTConnection(ctx context.Context, dest net.Destination) (stat.Connection, error) { | ||
if !dest.Address.Family().IsDomain() || dest.Address.Domain() != uot.UOTMagicAddress { | ||
return nil, os.ErrInvalid | ||
} | ||
packetConn, err := internet.ListenSystemPacket(ctx, &net.UDPAddr{IP: net.AnyIP.IP(), Port: 0}, h.streamSettings.SocketSettings) | ||
if err != nil { | ||
return nil, newError("unable to listen socket").Base(err) | ||
} | ||
conn := uot.NewServerConn(packetConn) | ||
return h.getStatCouterConnection(conn), nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//go:build !go1.18 | ||
|
||
package outbound | ||
|
||
import ( | ||
"context" | ||
"os" | ||
|
||
"github.com/xtls/xray-core/common/net" | ||
"github.com/xtls/xray-core/transport/internet/stat" | ||
) | ||
|
||
func (h *Handler) getUoTConnection(ctx context.Context, dest net.Destination) (stat.Connection, error) { | ||
return nil, os.ErrInvalid | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,4 +35,5 @@ message ClientConfig { | |
uint32 port = 2; | ||
string method = 3; | ||
string key = 4; | ||
bool udp_over_tcp = 5; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters