devgroup/sypex-geo-daemon
最新稳定版本:1.1.0
Composer 安装命令:
composer require devgroup/sypex-geo-daemon
包简介
Geo daemon on ReactPHP that resolves GEO information on given IP using SypexGeo database
README 文档
README
ReactPHP HTTP daemon that resolves GEO information on given IP
Usage
Tip: This daemon works extremely fast with PHP7!
Get the database file from official SypexGEO site. You need 'Sypex Geo City' database in UTF-8 encoding.
Install composer and run composer install or (php composer.phar install).
Start the daemon:
php server.php --host=0.0.0.0 --port=16001
Make your simple requests.
For example this requests http://127.0.0.1:16001/?ip=213.180.204.3 gives the following output(prettified for better look):
{
"city": {
"id": 524901,
"lat": 55.75222,
"lon": 37.61556,
"name_ru": "\u041c\u043e\u0441\u043a\u0432\u0430",
"name_en": "Moscow"
},
"region": {
"id": 524894,
"name_ru": "\u041c\u043e\u0441\u043a\u0432\u0430",
"name_en": "Moskva",
"iso": "RU-MOW"
},
"country": {
"id": 185,
"iso": "RU",
"lat": 60,
"lon": 100,
"name_ru": "\u0420\u043e\u0441\u0441\u0438\u044f",
"name_en": "Russia"
},
"time": "0.000406980515",
"error": false
}
Ping / Status monitoring
You can ping the daemon for html response http://0.0.0.0:16001/?ping=1 and http://0.0.0.0:16001/?ping-json=1 for json response.
统计信息
- 总下载量: 23
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 11
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2015-09-06