61 lines
2.3 KiB
C
61 lines
2.3 KiB
C
//
|
||
// HttpdnsInternalConstant.h
|
||
// NewHttpDNS
|
||
//
|
||
// Created by xuyecan on 2025/03/10.
|
||
// Copyright © 2024 trustapp.com. All rights reserved.
|
||
//
|
||
|
||
#ifndef HTTPDNS_INTERNAL_CONSTANT_H
|
||
#define HTTPDNS_INTERNAL_CONSTANT_H
|
||
|
||
static const int HTTPDNS_MAX_REQUEST_RETRY_TIME = 1;
|
||
|
||
static const int HTTPDNS_MAX_MANAGE_HOST_NUM = 100;
|
||
|
||
static const int HTTPDNS_PRE_RESOLVE_BATCH_SIZE = 5;
|
||
|
||
static const int HTTPDNS_DEFAULT_REQUEST_TIMEOUT_INTERVAL = 3;
|
||
|
||
static const NSUInteger HTTPDNS_DEFAULT_AUTH_TIMEOUT_INTERVAL = 10 * 60;
|
||
|
||
static NSString *const NEW_HTTPDNS_VALID_SERVER_CERTIFICATE_IP = @"203.107.1.1";
|
||
|
||
// 在iOS14å’ŒiOS16,网络信æ<C2A1>¯çš„获å<C2B7>–æ<E28093>ƒé™<C3A9>å<EFBFBD>—到越æ<C5A0>¥è¶Šç´§çš„é™<C3A9>åˆ?
|
||
// 除é<C2A4>žç”¨æˆ·ä¸»åŠ¨å£°æ˜Žéœ€è¦<C3A8>相关entitlement,ä¸<C3A4>ç„¶å<C2B6>ªèƒ½æ‹¿åˆ°ç©ºä¿¡æ<C2A1>¯
|
||
// 考虑大多数用户并ä¸<C3A4>会申请这些æ<E280BA>ƒé™<C3A9>,我们放弃针对细节的网络信æ<C2A1>¯å<C2AF>šç¼“å˜ç²’度隔ç¦?
|
||
// 出于兼容性考虑,网络è¿<C3A8>è<EFBFBD>¥å•†å<E280A0>ªæœ‰default一ç§<C3A7>ç±»åž?
|
||
#define HTTPDNS_DEFAULT_NETWORK_CARRIER_NAME @"default"
|
||
|
||
// 调度地å<C2B0>€ç¤ºä¾‹ï¼šhttp://106.11.90.200/sc/httpdns_config?account_id=153519&platform=ios&sdk_version=1.6.1
|
||
static NSString *const NEW_HTTPDNS_SCHEDULE_CENTER_REQUEST_HOST = @"httpdns-sc.NewAPPcs.com";
|
||
|
||
static NSString *const NEW_HTTPDNS_ERROR_MESSAGE_KEY = @"ErrorMessage";
|
||
|
||
static NSString *const kNewHttpdnsRegionConfigV4HostKey = @"service_ip";
|
||
static NSString *const kNewHttpdnsRegionConfigV6HostKey = @"service_ipv6";
|
||
|
||
static NSString *const kNewHttpdnsRegionKey = @"HttpdnsRegion";
|
||
|
||
#define SECONDS_OF_ONE_YEAR 365 * 24 * 60 * 60
|
||
|
||
static NSString *const NEW_HTTPDNS_ERROR_DOMAIN = @"HttpdnsErrorDomain";
|
||
|
||
static NSInteger const NEW_HTTPDNS_HTTPS_COMMON_ERROR_CODE = 10003;
|
||
static NSInteger const NEW_HTTPDNS_HTTP_COMMON_ERROR_CODE = 10004;
|
||
|
||
static NSInteger const NEW_HTTPDNS_HTTPS_TIMEOUT_ERROR_CODE = 10005;
|
||
static NSInteger const NEW_HTTPDNS_HTTP_TIMEOUT_ERROR_CODE = 10006;
|
||
static NSInteger const NEW_HTTPDNS_HTTP_OPEN_STREAM_ERROR_CODE = 10007;
|
||
static NSInteger const NEW_HTTPDNS_HTTPS_NO_DATA_ERROR_CODE = 10008;
|
||
|
||
static NSInteger const NEW_HTTP_UNSUPPORTED_STATUS_CODE = 10013;
|
||
static NSInteger const NEW_HTTP_PARSE_JSON_FAILED = 10014;
|
||
|
||
// åŠ å¯†é”™è¯¯ç ?
|
||
static NSInteger const NEW_HTTPDNS_ENCRYPT_INVALID_PARAMS_ERROR_CODE = 10021;
|
||
static NSInteger const NEW_HTTPDNS_ENCRYPT_RANDOM_IV_ERROR_CODE = 10022;
|
||
static NSInteger const NEW_HTTPDNS_ENCRYPT_FAILED_ERROR_CODE = 10023;
|
||
|
||
#endif
|