管理端全部功能跑通
This commit is contained in:
36
EdgeAdmin/web/views/@default/httpdns/apps/docs/android.md
Normal file
36
EdgeAdmin/web/views/@default/httpdns/apps/docs/android.md
Normal file
@@ -0,0 +1,36 @@
|
||||
# Android SDK
|
||||
|
||||
## 初始化
|
||||
|
||||
```java
|
||||
new InitConfig.Builder()
|
||||
.setContext(context)
|
||||
.setPrimaryServiceHost("httpdns-a.example.com")
|
||||
.setBackupServiceHost("httpdns-b.example.com")
|
||||
.setServicePort(443)
|
||||
.setSecretKey("your-sign-secret")
|
||||
.setEnableHttps(true)
|
||||
.buildFor("app1f1ndpo9");
|
||||
```
|
||||
|
||||
## 解析
|
||||
|
||||
```java
|
||||
HTTPDNSResult result = httpDnsService.getHttpDnsResultForHostSyncNonBlocking(
|
||||
"api.business.com",
|
||||
RequestIpType.auto,
|
||||
null,
|
||||
null
|
||||
);
|
||||
```
|
||||
|
||||
## 官方业务适配器
|
||||
|
||||
```java
|
||||
HttpDnsHttpAdapter adapter = HttpDns.buildHttpClientAdapter(httpDnsService);
|
||||
HttpDnsAdapterResponse resp = adapter.execute(
|
||||
new HttpDnsAdapterRequest("GET", "https://api.business.com/v1/ping")
|
||||
);
|
||||
```
|
||||
|
||||
固定策略:IP 直连 + 空 SNI + Host=真实域名,不回退到带 SNI。
|
||||
Reference in New Issue
Block a user