You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Lyor Goldstein (Jira)" <ji...@apache.org> on 2020/07/30 05:56:00 UTC

[jira] [Comment Edited] (SSHD-1046) Getting wrong IP in session

    [ https://issues.apache.org/jira/browse/SSHD-1046?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17167649#comment-17167649 ] 

Lyor Goldstein edited comment on SSHD-1046 at 7/30/20, 5:55 AM:
----------------------------------------------------------------

Please use dev@mina.apache.org mailing list for such questions... That being said, the answer is in the Javadoc
{code:java}
    /**
     * @return the socket address of remote peer.
     */
    SocketAddress getRemoteAddress();

    /**
     * @return the socket address of local machine which is associated with this session.
     */
    SocketAddress getLocalAddress();
{code}


was (Author: lgoldstein):
Please use dev@mina.apache.org mailing list for such questions...

> Getting wrong IP in session
> ---------------------------
>
>                 Key: SSHD-1046
>                 URL: https://issues.apache.org/jira/browse/SSHD-1046
>             Project: MINA SSHD
>          Issue Type: Question
>            Reporter: Sandeep
>            Priority: Major
>
> Hi Team, this is small query I have :
> On My VM by using ifconfig:  I get vm IP as *10.15.101.71*
>  
> But in sftpSubsystem when I try below code I got  *10.2.116.84*
>  
> {code:java}
> ServerSession session = getServerSession(); 
> InetSocketAddress addr = (InetSocketAddress) session.getRemoteAddress();
> String hostIP = addr.getAddress().getHostAddress(); 
> System.out.println("ip:"+hostIP )
> {code}
>  
> Output as :
> ip: *10.2.116.84*
>  
> *So can you help me to find the details* 
>  # why am getting this new ip which is not exit in our intranet 
>  # What is different between *session.getRemoteAddress()* vs *session.getLocalAddress()* methods?
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org