37 lines
1.3 KiB
Objective-C
37 lines
1.3 KiB
Objective-C
#import <Foundation/Foundation.h>
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
@interface HttpdnsEdgeResolveResult : NSObject
|
|
|
|
@property (nonatomic, copy) NSString *requestId;
|
|
@property (nonatomic, copy) NSArray<NSString *> *ipv4s;
|
|
@property (nonatomic, copy) NSArray<NSString *> *ipv6s;
|
|
@property (nonatomic, assign) NSInteger ttl;
|
|
|
|
@end
|
|
|
|
@interface HttpdnsEdgeService : NSObject
|
|
|
|
- (instancetype)initWithAppId:(NSString *)appId
|
|
primaryServiceHost:(NSString *)primaryServiceHost
|
|
backupServiceHost:(nullable NSString *)backupServiceHost
|
|
servicePort:(NSInteger)servicePort
|
|
signSecret:(nullable NSString *)signSecret;
|
|
|
|
- (void)resolveHost:(NSString *)host
|
|
queryType:(NSString *)queryType
|
|
completion:(void (^)(HttpdnsEdgeResolveResult *_Nullable result, NSError *_Nullable error))completion;
|
|
|
|
/// Connect by IP + HTTPS and keep Host header as business domain.
|
|
/// This path will not fallback to domain connect.
|
|
- (void)requestURL:(NSURL *)url
|
|
method:(NSString *)method
|
|
headers:(nullable NSDictionary<NSString *, NSString *> *)headers
|
|
body:(nullable NSData *)body
|
|
completion:(void (^)(NSData *_Nullable data, NSHTTPURLResponse *_Nullable response, NSError *_Nullable error))completion;
|
|
|
|
@end
|
|
|
|
NS_ASSUME_NONNULL_END
|