Count
Count

Reputation: 1423

get sender's IP

I have a tomcat application running on port no 443 , This application receives request from multiple application servers for password authentication . i e . users from multiple applications access this application(on 443) for password authentication on web browser , and are sent back after authentication

By goal is to bind my application (running on 443 ) for specific servers .(make inaccessible from the world .)

I have tried getting ip of the system from which i am getting the request , but had no luck .

 request.getRemoteAddr();
 request.getRemoteHost();

returns clients IP on which the webpage is open

I need the ip of the server from which request is sent to me

I also tried doing

request.getServerName();

but i am getting the ip of my own server not the sender

Upvotes: 0

Views: 408

Answers (1)

Angelo Fuchs
Angelo Fuchs

Reputation: 9941

you might want to use

request.getServerName();

to determinate whom the client wanted to address.

Upvotes: 1

Related Questions