File tree Expand file tree Collapse file tree 14 files changed +328
-2
lines changed
SDK/TCRPROXYSDK.xcframework
ios-arm64_x86_64-simulator/TCRPROXYSDK.framework
ios-arm64/TCRPROXYSDK.framework Expand file tree Collapse file tree 14 files changed +328
-2
lines changed Original file line number Diff line number Diff line change 1+
2+ //
3+ // ConnectionState.h
4+ // TCRPROXYSDK
5+ //
6+ // Created by cyy on 2025/09/30.
7+ //
8+
9+ #import < Foundation/Foundation.h>
10+
11+ NS_ASSUME_NONNULL_BEGIN
12+
13+ // / 连接状态枚举定义
14+ typedef NS_ENUM (NSInteger , ConnectionState) {
15+ // / 连接断开
16+ Disconnected = 0 ,
17+ // / 连接中/重连中
18+ Connecting = 1 ,
19+ // / 连接完成
20+ Connected = 2
21+ };
22+
23+ // / 连接状态工具类
24+ @interface ConnectionStateHelper : NSObject
25+
26+ // / 从状态值获取连接状态枚举
27+ // / @param state 状态值
28+ // / @return 连接状态枚举
29+ + (ConnectionState)connectionStateFromValue : (NSInteger )state ;
30+
31+ // / 获取连接状态描述
32+ // / @param state 连接状态
33+ // / @return 状态描述字符串
34+ + (NSString *)descriptionForConnectionState : (ConnectionState)state ;
35+
36+ @end
37+
38+ NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change 1+ //
2+ // Proxy.h
3+ // PROXY
4+ //
5+ // Created by cyy on 2025/8/28.
6+ //
7+
8+ #import < Foundation/Foundation.h>
9+ #import < TCRPROXYSDK/ProxyConnectionDelegate.h>
10+
11+ NS_ASSUME_NONNULL_BEGIN
12+
13+ // / 代理服务核心入口
14+ @interface Proxy : NSObject
15+
16+ // / 单例获取(默认日志级别4 Info)
17+ + (instancetype )sharedInstance ;
18+
19+ // / 单例获取(可指定日志级别,2-VERBOSE,3-DEBUG,4-INFO,5-WARNING,6-ERROR)
20+ + (instancetype )sharedInstanceWithLogLevel : (NSInteger )logLevel ;
21+
22+ // / 初始化代理服务(必须先于 startProxy 调用)
23+ // / @param relayInfoString 云端下发的代理中继信息
24+ // / @return 初始化是否成功
25+ - (BOOL )initWithRelayInfoString : (NSString *)relayInfoString ;
26+
27+ // / 初始化代理服务(宽带参数版,必须先于 startProxy 调用)
28+ // / @param bandwidth 设备带宽(如 @"1MB" 或 @"500KB"),最大 4MB
29+ // / @param relayInfoString 云端下发的代理中继信息
30+ // / @return 初始化是否成功
31+ - (BOOL )initWithBandwidth : (nullable NSString *)bandwidth relayInfoString : (NSString *)relayInfoString ;
32+
33+ // / 启动代理服务。须先 init 成功
34+ - (void )startProxy ;
35+
36+ // / 停止代理服务
37+ - (void )stopProxy ;
38+
39+ // / 设置连接状态变化监听器
40+ // / 通过此接口可以监听代理服务的连接状态变化,包括:
41+ // / - 连接断开
42+ // / - 连接中/重连中
43+ // / - 连接完成
44+ // / @param delegate 连接状态变化监听器,传nil可清除监听
45+ - (void )setConnectionDelegate : (nullable id <ProxyConnectionDelegate>)delegate ;
46+
47+ @end
48+
49+ NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change 1+
2+ //
3+ // ProxyConnectionDelegate.h
4+ // TCRPROXYSDK
5+ //
6+ // Created by cyy on 2025/09/30.
7+ //
8+
9+ #import < Foundation/Foundation.h>
10+ #import < TCRPROXYSDK/ConnectionState.h>
11+
12+ NS_ASSUME_NONNULL_BEGIN
13+
14+ // / 连接状态回调协议
15+ @protocol ProxyConnectionDelegate <NSObject >
16+
17+ // / 连接状态变化回调
18+ // / @param state 当前连接状态
19+ // / @param message 状态描述信息
20+ - (void )onConnectionStateChanged : (ConnectionState)state message : (NSString *)message ;
21+
22+ @end
23+
24+ NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change 1+ //
2+ // TCRPROXYSDK.h
3+ // TCRPROXYSDK
4+ //
5+ // Created by cyy on 2025/8/28.
6+ //
7+
8+ #import < Foundation/Foundation.h>
9+
10+ // ! Project version number for TCRPROXYSDK.
11+ FOUNDATION_EXPORT double TCRPROXYSDKVersionNumber;
12+
13+ // ! Project version string for TCRPROXYSDK.
14+ FOUNDATION_EXPORT const unsigned char TCRPROXYSDKVersionString[];
15+
16+ #import < TCRPROXYSDK/Proxy.h>
17+ #import < TCRPROXYSDK/ConnectionState.h>
18+ #import < TCRPROXYSDK/ProxyConnectionDelegate.h>
Original file line number Diff line number Diff line change 1+ framework module TCRPROXYSDK {
2+ umbrella header "TCRPROXYSDK.h"
3+
4+ export *
5+ module * { export * }
6+ }
Original file line number Diff line number Diff line change 1+
2+ //
3+ // ConnectionState.h
4+ // TCRPROXYSDK
5+ //
6+ // Created by cyy on 2025/09/30.
7+ //
8+
9+ #import < Foundation/Foundation.h>
10+
11+ NS_ASSUME_NONNULL_BEGIN
12+
13+ // / 连接状态枚举定义
14+ typedef NS_ENUM (NSInteger , ConnectionState) {
15+ // / 连接断开
16+ Disconnected = 0 ,
17+ // / 连接中/重连中
18+ Connecting = 1 ,
19+ // / 连接完成
20+ Connected = 2
21+ };
22+
23+ // / 连接状态工具类
24+ @interface ConnectionStateHelper : NSObject
25+
26+ // / 从状态值获取连接状态枚举
27+ // / @param state 状态值
28+ // / @return 连接状态枚举
29+ + (ConnectionState)connectionStateFromValue : (NSInteger )state ;
30+
31+ // / 获取连接状态描述
32+ // / @param state 连接状态
33+ // / @return 状态描述字符串
34+ + (NSString *)descriptionForConnectionState : (ConnectionState)state ;
35+
36+ @end
37+
38+ NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change 1+ //
2+ // Proxy.h
3+ // PROXY
4+ //
5+ // Created by cyy on 2025/8/28.
6+ //
7+
8+ #import < Foundation/Foundation.h>
9+ #import < TCRPROXYSDK/ProxyConnectionDelegate.h>
10+
11+ NS_ASSUME_NONNULL_BEGIN
12+
13+ // / 代理服务核心入口
14+ @interface Proxy : NSObject
15+
16+ // / 单例获取(默认日志级别4 Info)
17+ + (instancetype )sharedInstance ;
18+
19+ // / 单例获取(可指定日志级别,2-VERBOSE,3-DEBUG,4-INFO,5-WARNING,6-ERROR)
20+ + (instancetype )sharedInstanceWithLogLevel : (NSInteger )logLevel ;
21+
22+ // / 初始化代理服务(必须先于 startProxy 调用)
23+ // / @param relayInfoString 云端下发的代理中继信息
24+ // / @return 初始化是否成功
25+ - (BOOL )initWithRelayInfoString : (NSString *)relayInfoString ;
26+
27+ // / 初始化代理服务(宽带参数版,必须先于 startProxy 调用)
28+ // / @param bandwidth 设备带宽(如 @"1MB" 或 @"500KB"),最大 4MB
29+ // / @param relayInfoString 云端下发的代理中继信息
30+ // / @return 初始化是否成功
31+ - (BOOL )initWithBandwidth : (nullable NSString *)bandwidth relayInfoString : (NSString *)relayInfoString ;
32+
33+ // / 启动代理服务。须先 init 成功
34+ - (void )startProxy ;
35+
36+ // / 停止代理服务
37+ - (void )stopProxy ;
38+
39+ // / 设置连接状态变化监听器
40+ // / 通过此接口可以监听代理服务的连接状态变化,包括:
41+ // / - 连接断开
42+ // / - 连接中/重连中
43+ // / - 连接完成
44+ // / @param delegate 连接状态变化监听器,传nil可清除监听
45+ - (void )setConnectionDelegate : (nullable id <ProxyConnectionDelegate>)delegate ;
46+
47+ @end
48+
49+ NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change 1+
2+ //
3+ // ProxyConnectionDelegate.h
4+ // TCRPROXYSDK
5+ //
6+ // Created by cyy on 2025/09/30.
7+ //
8+
9+ #import < Foundation/Foundation.h>
10+ #import < TCRPROXYSDK/ConnectionState.h>
11+
12+ NS_ASSUME_NONNULL_BEGIN
13+
14+ // / 连接状态回调协议
15+ @protocol ProxyConnectionDelegate <NSObject >
16+
17+ // / 连接状态变化回调
18+ // / @param state 当前连接状态
19+ // / @param message 状态描述信息
20+ - (void )onConnectionStateChanged : (ConnectionState)state message : (NSString *)message ;
21+
22+ @end
23+
24+ NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change 1+ //
2+ // TCRPROXYSDK.h
3+ // TCRPROXYSDK
4+ //
5+ // Created by cyy on 2025/8/28.
6+ //
7+
8+ #import < Foundation/Foundation.h>
9+
10+ // ! Project version number for TCRPROXYSDK.
11+ FOUNDATION_EXPORT double TCRPROXYSDKVersionNumber;
12+
13+ // ! Project version string for TCRPROXYSDK.
14+ FOUNDATION_EXPORT const unsigned char TCRPROXYSDKVersionString[];
15+
16+ #import < TCRPROXYSDK/Proxy.h>
17+ #import < TCRPROXYSDK/ConnectionState.h>
18+ #import < TCRPROXYSDK/ProxyConnectionDelegate.h>
You can’t perform that action at this time.
0 commit comments