take port from env
use the x-forwarded-for header to get ip
Revert "use the x-forwarded-for header to get ip"

This reverts commit 673bd2d2c9ac484aeba2f5373d9f92783a647dd1.