iputil

package module
v0.0.0-...-fa20b08 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2024 License: GPL-3.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIP

func GetIP(r *http.Request) string

获取访问IP

func GetLocal

func GetLocal() string

获取当前本地使用的主IP地址

func GetLocalIpV4

func GetLocalIpV4() string

getLocalIpV4 获取 IPV4 IP,没有则返回空 有返回虚拟网卡的风险

func GetOutBoundIP

func GetOutBoundIP() (ip string, err error)

获取本机ip地址

func IsPortAvailable

func IsPortAvailable(port string) bool

判断指定端口是否空闲,空闲返回true 利用Go标准库中的net包和错误处理来判断端口是否可用

func RemoteIp

func RemoteIp(req *http.Request) string

获取请求中的IP

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL