QTcpServer Error Setting proxy

  • Hi all, Im trying to set proxy for a QTcpSopcket, but suddenly when I call connectToHost()
    I face with this error :" QAbstractSocket::UnsupportedSocketOperationError , The requested socket operation is not supported by the local operating system (e.g., lack of IPv6 support). "

    where is the problem?

    here the code :

    @m_tcpSocket = new QTcpSocket();

  • p{direction:rtl;text-align:right;}. شما در کل نیازی به setType ندارید و توی tcp/ip معنی نداره اینکار. اگر نیاز به request و response از http دارید بجاش از QNetwrokAccessManager باید استفاده کنید.


  • na ma mikham bara socketam proxy set konam. Qhttp , QNetwrokAccessManager ina moshkeli nadaran.

    age type ro moshkhas nakoni ke khodesh type ro default mizare
    ke deafult ham applicationProxy hastesh.

    QNetworkProxy::DefaultProxy 0 Proxy is determined based on the application proxy set using setApplicationProxy()

    ke age setApplicationProxy() nakarde bashid typesh mishe NoProxy va kolan proxy tatil mishe.

  • p{direction:rtl;text-align:right;}. طبق مستندات

    p{direction:ltr;text-align:left;}. SOCKS 5    Generic proxy for any kind of connection. Supports TCP, UDP, binding to a port (incoming connections) and authentication.

    p{direction:ltr;text-align:left;}. HTTP    Implemented using the "CONNECT" command, supports only outgoing TCP connections; supports authentication.

    p{direction:ltr;text-align:left;}. Caching-only HTTP    Implemented using normal HTTP commands, it is useful only in the context of HTTP requests (see QNetworkAccessManager)

    p{direction:ltr;text-align:left;}. Caching FTP    Implemented using an FTP proxy, it is useful only in the context of FTP requests (see QNetworkAccessManager)


  • p{direction:rtl;text-align:right;}. QNetworkProxy proxy;
     proxy.setType(QNetworkProxy::Socks5Proxy); or proxy.setType(QNetworkProxy::HttpProxy);

    p{direction:rtl;text-align:right;}.  QNetworkProxy::setApplicationProxy(proxy);


  • p{direction:rtl;text-align:right;}. اقا من یه سوال داشت سر سوکت برای چی میخوای پروکسی ست کنی؟

    p{direction:rtl;text-align:right;}. اگه میخواهی وب را بفرستی رو پروکسی که باید از httpproxy استفاده کنی .

    p{direction:rtl;text-align:right;}. اگر هم میخواهی  پروکسی سرور کلاینت راه بندازی که این روشش نیست.



Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.