Skip to content

Commit

Permalink
fix: v2ray socks server udp mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
arm64v8a committed Jan 13, 2023
1 parent 650e842 commit 41096c2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion core_commit.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a35785438ebee68eb9d2544d671769a318182687
07a3c272a42ce0fe834a645176d663ce3b193e49
7 changes: 3 additions & 4 deletions go/cmd/nekoray_core/grpc_ray.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"time"

"github.com/sirupsen/logrus"
core "github.com/v2fly/v2ray-core/v5"
)

type server struct {
Expand Down Expand Up @@ -212,12 +213,10 @@ func (s *server) Test(ctx context.Context, in *gen.TestReq) (out *gen.TestResp,
result := make(chan string, 0)

go func() {
stunServer := "206.53.159.130:3478"
stunAddr, _ := net.ResolveUDPAddr("udp4", stunServer)
pc, err := i.DialUDP(stunAddr)
pc, err := core.DialUDP(context.TODO(), i.Core)
if err == nil {
stunClient := stun.NewClientWithConnection(pc)
stunClient.SetServerAddr(stunServer)
stunClient.SetServerAddr("stun.ekiga.net:3478")
nat, host, err, fake := stunClient.Discover()
if err == nil {
if host != nil {
Expand Down
2 changes: 1 addition & 1 deletion matsuri_commit.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2e5069a2aa17e4aa5cb3ac4d87bc155f0afb2f09
82662c5ec8266d42513454965f09516e40e6d495
3 changes: 3 additions & 0 deletions ui/edit/edit_custom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ void EditCustom::onStart(QSharedPointer<NekoRay::ProxyEntity> _ent) {
auto tmpEnt = NekoRay::ProfileManager::NewProxyEntity("custom");
auto bean = tmpEnt->CustomBean();
SAVE_CUSTOM_BEAN
// 补充
bean->serverAddress = get_edit_text_serverAddress();
bean->serverPort = get_edit_text_serverPort().toInt();
if (bean->core.isEmpty()) return;
//
auto result = NekoRay::BuildConfig(tmpEnt, false, false);
Expand Down

0 comments on commit 41096c2

Please sign in to comment.