Browse Source

1.瑞云新的打洞方案

huangxiaodong 1 year ago
parent
commit
0753efa0ce

+ 1 - 1
创维盒子/RayProxy/Classes/RaylinkProxy.h

@@ -39,7 +39,7 @@ typedef void(^RaylinkProxyConnectBlock)(int port);
 
 - (void)closeHttpService:(NSString *)sdnId;
 
-- (BOOL)addSdnId:(NSString *)sdnId allowPort:(NSUInteger)port;
+- (BOOL)addSdnId:(NSString *)sdnId ip:(NSString *)ip allowPort:(NSUInteger)port;
 
 - (NSString *)getSdnId;
 

+ 2 - 2
创维盒子/RayProxy/Classes/RaylinkProxy.mm

@@ -139,13 +139,13 @@
     
 }
 
-- (BOOL)addSdnId:(NSString *)sdnId allowPort:(NSUInteger)port {
+- (BOOL)addSdnId:(NSString *)sdnId ip:(NSString *)ip allowPort:(NSUInteger)port {
     
     RayLinkConnectionInfo *connectInfo = _connectInfos[sdnId];
     
     if (connectInfo) {
         NSLog(@"TyphoonMultiProxy_AddHttpFirewallAllowAddress: %d", (int)port);
-        TyphoonMultiProxy_AddHttpFirewallAllowAddress(connectInfo.pHandle.pointerValue, "127.0.0.1", (int)port);
+        TyphoonMultiProxy_AddHttpFirewallAllowAddress(connectInfo.pHandle.pointerValue, (char *)[ip cStringUsingEncoding:NSUTF8StringEncoding], (int)port);
         return YES;
     }
     

BIN
创维盒子/RayProxy/libzerotier-one.a


+ 3 - 3
创维盒子/双子星云手机/CloudPlayer/PlayerViewController.mm

@@ -271,7 +271,7 @@ ComontAlretViewControllerDelegate>
         }
         else{
             if([[connectDeviceManager shareInstance] curConnectDeviceState] == DeviceConnectDeciceOk){
-                ip = @"127.0.0.1";
+                ip = ruiyunlinkIp;
                 internetVideoPort = [[connectDeviceManager shareInstance] tcpPortStr];
                 [self didCanConnectServerFun];
             }
@@ -512,7 +512,7 @@ ComontAlretViewControllerDelegate>
         wsPort = @"9300";
     }
     else{
-        ip = @"127.0.0.1";
+        ip = ruiyunlinkIp;
         wsPort = [[connectDeviceManager shareInstance] tcpPortStr];
     }
     
@@ -1495,7 +1495,7 @@ NSDate *lastVideoTome;/*上一帧数据时间*/
         internetVideoPort = @"9100";
     }
     else{
-        ip = @"127.0.0.1";
+        ip = ruiyunlinkIp;
         internetVideoPort = [[connectDeviceManager shareInstance] tcpPortStr];
     }
     

+ 4 - 0
创维盒子/双子星云手机/connectDeviceManager/connectDeviceManager.h

@@ -9,6 +9,10 @@
 #import "DeviceThirdIdModel.h"
 NS_ASSUME_NONNULL_BEGIN
 
+//#define ruiyunlinkIp @"172.17.0.2"
+//#define ruiyunlinkIp @"172.17.0.1"
+#define ruiyunlinkIp @"127.0.0.1"
+
 typedef enum{
     DeviceConnectUnknown = -1,
     DeviceConnectGetThridMsging = 0,

+ 4 - 4
创维盒子/双子星云手机/connectDeviceManager/connectDeviceManager.m

@@ -332,8 +332,8 @@ static connectDeviceManager *connectDeviceManagerInstance = nil;
         self.tcpPortStr = [[NSString alloc] initWithFormat:@"%ld",self.tcpPort];
         
         /// 5. 添加端口防火墙
-        [RaylinkProxy.sharedManager addSdnId:sdnId allowPort:9300];
-        [RaylinkProxy.sharedManager addSdnId:sdnId allowPort:9100];
+        [RaylinkProxy.sharedManager addSdnId:sdnId ip:ruiyunlinkIp allowPort:9300];
+        [RaylinkProxy.sharedManager addSdnId:sdnId ip:ruiyunlinkIp allowPort:9100];
         
         [cachesFileManager writeLogsWithMsg:@"onProxyConnected connectToHost"];
         
@@ -439,8 +439,8 @@ static connectDeviceManager *connectDeviceManagerInstance = nil;
     NSString *sdnId = self.DeviceThirdIdMod.data.sdnId;
     self.tcpPort = [RaylinkProxy.sharedManager createHttpService:sdnId];
     self.tcpPortStr = [[NSString alloc] initWithFormat:@"%ld",self.tcpPort];
-    [RaylinkProxy.sharedManager addSdnId:sdnId allowPort:9300];
-    [RaylinkProxy.sharedManager addSdnId:sdnId allowPort:9100];
+    [RaylinkProxy.sharedManager addSdnId:sdnId ip:ruiyunlinkIp allowPort:9300];
+    [RaylinkProxy.sharedManager addSdnId:sdnId ip:ruiyunlinkIp allowPort:9100];
     
 }