Created
October 22, 2014 09:52
-
-
Save pulse00/3f6ee815ceda619cf9fc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Object rawRequest = RequestCycle.get().getRequest().getContainerRequest(); | |
if (rawRequest instanceof HttpServletRequest) { | |
HttpServletRequest servletRequest = (HttpServletRequest) rawRequest; | |
String proxyHost = servletRequest.getHeader("X-Forwarded-Host"); | |
String proxyPort = servletRequest.getHeader("X-Forwarded-Port"); | |
if (proxyHost != null) { | |
hostname = proxyHost; | |
} | |
if (proxyPort != null) { | |
port = Integer.parseInt(proxyPort); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment