1
wei
2021-01-21 62d098cb78296feaa6f786a20748921338db838c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//
// TuyaSmartHTTPDNS.h
// TuyaSmartBaseKit
//
// Copyright (c) 2014-2021 Tuya Inc. (https://developer.tuya.com)
 
#import <Foundation/Foundation.h>
 
NS_ASSUME_NONNULL_BEGIN
 
/// @brief TuyaSmartHTTPDNS is another solution for DNS query instead of system DNS service.
///
/// The DNS query can be done through http to prevent DNS cache pollution.
@interface TuyaSmartHTTPDNS : NSObject
 
+ (instancetype)sharedInstance;
 
/// Asynchronous resolution interface, first query the cache, if it exists then return the result, if not return nil and asynchronous domain name resolution to update the cache.
/// @param host Domain name (e.g. www.tuya.com).
/// @return The resolution result corresponding to the domain name.
- (NSString *)getIpWithHost:(NSString *)host;
 
 
/// Set whether the domain name is downgraded or not.
/// @param host Domain Name.
/// @param enable Whether to downgrade.
- (void)setDegradationWithHost:(NSString *)host enable:(BOOL)enable;
 
@end
 
NS_ASSUME_NONNULL_END