Hi,
After debugging the issue in windows, we came to know that "random port" generation logic in runtime is getting failed if we configured proxy server in windows.
Below are the code where we are finding random free port and use with our URL "localhost:<port>". Below code return "0" as port value so application is not able to start and it hangs on splash screen. Here, if we configured proxy server in windows then "bind" method always return false and gives message "Operation not permitted" but when we disable proxy server then below code gives valid random port number.
QTcpSocket socket;
socket.bind(0, QTcpSocket::ShareAddress);
port = socket.localPort();
Same happens with Linux OS - when user defined "http_proxy" environment variable and run pgAdmin4 application then above code fails and gives "0" as random port number and application hangs on splash screen.
From the below Qt 5.8 released link, we came to know that "random port" generation work well after setting application level proxy.
QNetworkProxy::setApplicationProxy(QNetworkProxy());
After setting above, "bind" method return true and gives correct port number and application starts working. We are also setting "setUseSystemConfiguration=true" after setting application level proxy which will override the setting and use platform specific system proxy configuration.
From the below link, it looks like fixed in Qt 5.9.
I have tested with Qt 5.8 Web Engine and webkit in windows. Do review it and let me know for comments.
Thanks,
Neel Patel