Skip to content

GoIP接口 ​

介绍 ​

使用Go实现的可私有化部署公网IP获取服务,支持IPV4、IPV6(需要服务端支持IPV6)

安装教程 ​

gitee下载页面-Deb及二进制可执行程序

Deb安装包HTTP直链下载页

使用说明 ​

shell
 # ips -h
Usage of ips:
  -bg string
        设置背景图标,必须放在static目录 (default "bg1.jpg")
  -d    显示更多运行信息(debug)
  -f string
        设置favicon.ico路径 (default "images/favicon.ico")
  -p int
        设置服务器端口 (default 22010)
  -pid
        写入pid文件(用于system管理)
  -t string
        设置static路径 (default "static")
  -u4 string
        设置IPV4跳转URL (default "https://ip.liumou.site/")
  -u6 string
        设置IPV6跳转URL (default "http://eq12.debian6.liumou.site:22010/")
  -v    显示版本号
root@l ~/git/gitee/go/go-ip-interface
 #

Deb安装服务启动 ​

安装成功之后,通过下面的命令管理服务

shell
sudo systemctl start ips.service # 启动服务
shell
sudo systemctl stop ips.service # 停止服务
shell
sudo systemctl restart ips.service # 重启服务
shell
sudo systemctl enable ips.service # 设置服务开机自启
shell
sudo systemctl disable ips.service # 取消服务开机自启
shell
sudo systemctl status ips.service # 查询服务状态

效果图 ​

首页-IPV4 ​

index

首页-IPV6 ​

index6

局域网 ​

LAN

Api接口-文本 ​

api

Api接口-Json ​

json

通过Python请求 ​

req

启动 ​

run

访问服务 ​

默认端口访问 ​

程序默认以22010端口启动,启动成功之后本机访问

http://127.0.0.1:22010

或者将127.0.0.1改成自己的IP地址

修改端口 ​

如需修改端口,对于systemd启动的可使用下面的命令修改,把80改成需要使用的端口号即可

shell
sudo sed -i 's/pid.*/pid -p 80/g' /lib/systemd/system/ips.service

对于直接使用二进制的,请根据帮助信息对应传参启动即可

Demo ​

演示站点-IPV4

演示站点-IPV6

Last updated:

♪ 准备播放...