Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dDaTr-00033W-1z for pgadmin-hackers@arkaria.postgresql.org; Wed, 24 May 2017 17:53:55 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dDaTq-0002Rm-J0 for pgadmin-hackers@arkaria.postgresql.org; Wed, 24 May 2017 17:53:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dDaTc-000237-E9 for pgadmin-hackers@postgresql.org; Wed, 24 May 2017 17:53:40 +0000 Received: from mail-it0-x233.google.com ([2607:f8b0:4001:c0b::233]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dDaTY-0003B0-A8 for pgadmin-hackers@postgresql.org; Wed, 24 May 2017 17:53:39 +0000 Received: by mail-it0-x233.google.com with SMTP id o5so43188836ith.1 for ; Wed, 24 May 2017 10:53:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pgadmin-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=uZUuGTdF91Pj8wxHWPflYmnhuKOlyoecc1Ef6nImk+c=; b=V9TjTamzsTxog+gcAW1qd3J0gWAFNpjGQ2l7ilbKQotj/n3dr6rVMIad+PGwZPYSY1 Ug0Y9kBiBv6aU2aIw8jLfyX1r7prdzlOBXglvQBm2E8TizCCWPGFrbohpz15K7sCWn2X Y6OlWVjtVM+ejWkszh/kXAF5YlfR6j3kaVPwApL2BTqAJpE89euCd+qc9dOD/uOmMyM9 aJwd/Fm2HvR7HIYRqDM/oA+XksOuK2hcU+DXUXWkH81YGxUrjygHHAb1Z6Ww4oFiNwOP dGcyC5aVK9tTPPHCX5uM7TCslkeavKw4MHX5V5xauaoDQY1ECpoZ6FZ7ww136aZInWPp K32w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=uZUuGTdF91Pj8wxHWPflYmnhuKOlyoecc1Ef6nImk+c=; b=EEMrsrp64fedcX/ojy5lA9YR3ghzFo5+pZ1PhQF//RfeOXWizUjFuF3E8yI4DnBEfc DchKMXPAQ4TgBGbv1wv1TGf7hbSqQDE2Etf0R98VHWyKZF16x/d1sMw2ZIHu/X3ga+b6 3g0lH+w0NT3xNshIjqnCTV8niLzZCRHwNGQ0qAZFQGR9w4GhDThpoxWAIaio4T5UxYPX AI5ATcnm+eUNgaTv8smmTgQbObiexgZZnN5WgclHhQIkwbrYGTzWexOHQ6z77tDl2nS/ 3GToOMDVYuvfDWHagGXGQTCC6gUL4f2XzvE2DOvSbMl4X1YOzKIliE0V/P2xmzNAy1rr yz7A== X-Gm-Message-State: AODbwcAK7+bz1hcwasDzoaUzjXqkozNL/MKf6RjoMGZc8CVsm2julWNg FCrWFgm3T9iUwB+mZb0NtyCL0l4BH2Gm X-Received: by 10.36.74.3 with SMTP id k3mr10066079itb.28.1495648414511; Wed, 24 May 2017 10:53:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.174.147 with HTTP; Wed, 24 May 2017 10:53:33 -0700 (PDT) In-Reply-To: References: From: Dave Page Date: Wed, 24 May 2017 13:53:33 -0400 Message-ID: Subject: Re: [pgAdmin4][runtime][patch]: RM#2398 - Proxy not bypassed for embedded server in runtime on Windows To: Neel Patel Cc: Maxim Zakharov , pgadmin-hackers Content-Type: text/plain; charset="UTF-8" X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgadmin-hackers Precedence: bulk Sender: pgadmin-hackers-owner@postgresql.org Good catch - thanks Neel. I don't have my main dev laptop with me, so I'll have to test this next week. Watch this space :-) On Wed, May 24, 2017 at 4:22 AM, Neel Patel wrote: > 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:". 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. > http://blog.qt.io/blog/2017/01/23/qt-5-8-released/ > > 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. > https://bugreports.qt.io/browse/QTBUG-58374 > https://codereview.qt-project.org/#/c/186124/ > > 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 > > On Fri, May 19, 2017 at 4:37 PM, Dave Page wrote: >> >> On Thu, May 18, 2017 at 3:42 PM, Neel Patel >> wrote: >> > Hi Dave, >> > >> > Please find attached patch for the fix of RM#2398 - "Proxy not bypassed >> > for >> > embedded server in runtime on Windows". >> > >> > Observation:- >> > We have observed this issue only with Qt WebEngine. We have not observed >> > this issue with Webkit ( Tested with Qt 5.3 ). >> > >> > Issue:- >> > If user set option "Bypass proxy server for local addresses" then >> > WebEngine >> > doesn't bypass the request for local addresses even if that option is >> > set. >> > >> > Solution:- >> > Now if user set option "Bypass proxy server for local addresses" then >> > Web >> > Engine bypass the request for localhost and if user unset then request >> > will >> > not be bypassed. >> > >> > Please find attached fix for this issue. Do review and test it and let >> > me >> > know for any issue. >> >> Noted on the ticket: >> >> ==== >> Right, but as Maxim has noted, the proxy code is there to allow users >> to browse to online docs, so it can't just be disabled. >> >> This likely worked in 1.3 as that used QtWebEngine (which had a bunch >> of other issues). We need to fix it for QtWebKit, so that it honors >> the bypass proxy for local addresses option. >> ==== >> >> >> -- >> Dave Page >> Blog: http://pgsnake.blogspot.com >> Twitter: @pgsnake >> >> EnterpriseDB UK: http://www.enterprisedb.com >> The Enterprise PostgreSQL Company > > -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-hackers