Original post

This might do what you want: https://github.com/tomasen/realip