Important: Please read the Qt Code of Conduct -

Find out my ip address on the internet by Qt

  • I could get my ip address from this website,is it possible to obtain that address by Qt?

    Would like to create a ftp server and let other's connect to my pc, thanks

  • What I trying to do is

    server_ = new SslServer(this);   
    server_->listen(QHostAddress::AnyIPv4, port);
    //ftp protocal implementation

    Is it possible to listen to the other pc if I give them the address I obtain from the ""?

  • Moderators

    I suggest you use a free (signup required though) Webservice (like for the sake of simplicity.
    Use QNetworkAccessManager to make a GET request to their API and parse the JSON response with QJsonDocument.

    But note the IP is only required if you want to let the clients connect via internet (assuming port forwarding is correctly setup on your router).

    For your local LAN IP address you can use:

    QList<QHostAddress> ipAddressesList = QNetworkInterface::allAddresses();
    for( int i = 0; i < ipAddressesList.size(); ++i ) {
        if( != QHostAddress::LocalHost && )
                qDebug() <<;

  • Banned

    This post is deleted!

  • @tham Hi,
    to add to what @raven-worx said we would need to know more (mainly, as this has been pointed out, are you referring to the public IP address of your Internet node or to the machine assigned local IP?) as use case will differ. Also, additional actions like port forwarding might be required.
    Could you please describe what's your intended use case? How would you like your software to work?

Log in to reply