forked from xindong/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
11 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,27 @@ | ||
# 心动 httpdns 服务接口文档 | ||
### 心动 httpdns 服务接口文档 | ||
|
||
本接口可以查询特定域名对应的IP地址。 | ||
|
||
## APIs | ||
#### APIs | ||
|
||
| 端口 | 协议 | 请求 | 返回 | | ||
| ------ | ------ | ------ | ------ | | ||
| 1053 | http | http://httpdns.xdapp.com:1053/dns?d={$domain} | 字符串,该域名的ip地址 | | ||
| 1153 | tcp | tcp://httpdns.xdapp.com:1153 字符串类型,$domain + "\\n" | 字符串,该域名的ip地址 | | ||
|
||
|
||
## 通过 IP 调用 | ||
#### 通过 IP 调用 | ||
|
||
使用 54.223.165.195 代替域名 httpdns.xdapp.com | ||
|
||
## 测试 http 接口 | ||
#### 测试 http 接口 | ||
```bash | ||
curl "http://httpdns.xdapp.com:1053/dns?d=tomasen.org" | ||
``` | ||
|
||
`curl "http://httpdns.xdapp.com:1053/dns?d=tomasen.org"` | ||
#### 测试 tcp 接口 | ||
```bash | ||
printf "tomasen.org\n" | nc httpdns.xdapp.com 1153 | ||
``` | ||
|
||
## 测试 tcp 接口 | ||
|
||
`printf "tomasen.org\n" | nc httpdns.xdapp.com 1153` | ||
|
||
- | ||
_如需自行部署可以参考 [项目源代码](https://github.com/tomasen/httpdns)_ |