Compare commits
2 Commits
022a755fdf
...
cfe1f4c04d
Author | SHA1 | Date | |
---|---|---|---|
cfe1f4c04d | |||
eeeca10078 |
4
ip.go
4
ip.go
@ -39,12 +39,12 @@ func (i *ip) GetHostIP() string {
|
|||||||
return hostIP
|
return hostIP
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetRemoteIp 获取远端IP
|
// GetRemoteIP 获取远端IP
|
||||||
//
|
//
|
||||||
// Author : go_developer@163.com<白茶清欢>
|
// Author : go_developer@163.com<白茶清欢>
|
||||||
//
|
//
|
||||||
// Date : 5:35 下午 2021/11/22
|
// Date : 5:35 下午 2021/11/22
|
||||||
func (i *ip) GetRemoteIp(req *http.Request) string {
|
func (i *ip) GetRemoteIP(req *http.Request) string {
|
||||||
// Try via request
|
// Try via request
|
||||||
remoteIP, _, err := net.SplitHostPort(req.RemoteAddr)
|
remoteIP, _, err := net.SplitHostPort(req.RemoteAddr)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user