Skip to content

Simple Golang package to access an IP address from an http.Request struct

License

Notifications You must be signed in to change notification settings

theTardigrade/golang-ip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

golang-ip

This is a simple Golang package to access an IP address from an http.Request struct.

Example

package main

import (
	"fmt"
	"net/http"

	ip "github.com/theTardigrade/golang-ip"
)

func main() {
	r := &http.Request{
		RemoteAddr: "192.158.1.38:80",
	}

	fmt.Println(ip.Get(r))
}

About

Simple Golang package to access an IP address from an http.Request struct

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages