/ipinfo

Used in a POC for geoIP considerations (Azure Traffic Manager). The endpoint returns the IP requester location and must be nearly the endpoint location.

Primary LanguageJava

Ipinfo

Build Status Code Coverage


Table of Contents


Java

Build

mvn clean install

Run

Behind a corporate proxy

java -Djava.net.preferIPv4Stack=true -Dhttp.proxyHost=$PROXY_HOST -Dhttp.proxyPort=$PROXY_PORT -jar target/app.jar  

To simulate a remote client, populate the http request header X-FORWARDED-FOR with a public IP.

curl -H X-FORWARDED-FOR:$(curl -s icanhazip.com) http://localhost:8080

Docker

Build

docker build -t scizeron/ipinfo .

Run

Behind a corporate proxy

docker run -d -p8080:8080 -e "JAVA_OPTS=-Djava.net.preferIPv4Stack=true -Dhttp.proxyHost=$PROXY_HOST -Dhttp.proxyPort=$PROXY_PORT" scizeron/ipinfo

Push

Push the docker image on hub.docker.com (docker login)

docker push scizeron/ipinfo

See all tags here.

docker-image

Swarm

docker service create --name ipinfo --replicas 1 --publish 8080:8080 scizeron/ipinfo