Return-Path: X-Original-To: apmail-jmeter-user-archive@www.apache.org Delivered-To: apmail-jmeter-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 78F1DDEE9 for ; Mon, 19 Nov 2012 23:42:20 +0000 (UTC) Received: (qmail 88277 invoked by uid 500); 19 Nov 2012 23:42:19 -0000 Delivered-To: apmail-jmeter-user-archive@jmeter.apache.org Received: (qmail 88176 invoked by uid 500); 19 Nov 2012 23:42:19 -0000 Mailing-List: contact user-help@jmeter.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "JMeter Users List" Delivered-To: mailing list user@jmeter.apache.org Received: (qmail 88165 invoked by uid 99); 19 Nov 2012 23:42:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Nov 2012 23:42:19 +0000 X-ASF-Spam-Status: No, hits=2.8 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of shettyd@gmail.com designates 209.85.214.43 as permitted sender) Received: from [209.85.214.43] (HELO mail-bk0-f43.google.com) (209.85.214.43) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Nov 2012 23:42:15 +0000 Received: by mail-bk0-f43.google.com with SMTP id jf20so2238496bkc.2 for ; Mon, 19 Nov 2012 15:41:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=6XGZR9u3RYMXbX4N8ee0Dh7D+GiGSNEsMzpNeRnkR9U=; b=cFILOgYEecpOFkydRLhnha0/g8WK3HrIG508y/1t/VHXztkoyGy1bq73Ut4I8PJV0E TkqSw0okoC5ToTUWqzpjVtZ1ddA0ZI198M1kOeiCMpFgjFETX0q6SJBBgVyCEtnubFVe 0m678gvCfxrm55UWn5oTWfVLK7l1U1oIL2nHfrFlHlPua8NRMBKDtWNZVBkPDluln0dG iUytNZT3UDiij/HON2OOVc8P8dXt72UWHcMDKTXJfLOKD+AR6aPFG1yBtAi/H1V73v0u o2lLJFBVfAtBGdGIV0Alle6hzq3Ngd+fuT70XvlQFhesPID09kSl1Chr+MWk/nEGxjlW ssoQ== MIME-Version: 1.0 Received: by 10.204.9.11 with SMTP id j11mr533098bkj.53.1353368513352; Mon, 19 Nov 2012 15:41:53 -0800 (PST) Received: by 10.204.40.74 with HTTP; Mon, 19 Nov 2012 15:41:53 -0800 (PST) In-Reply-To: References: <1353349121553-5715344.post@n5.nabble.com> Date: Mon, 19 Nov 2012 15:41:53 -0800 Message-ID: Subject: Re: How to force the port to be used in an HTTP Sampler? From: Deepak Shetty To: JMeter Users List Content-Type: multipart/alternative; boundary=00151758f4227d132904cee1a9c7 X-Virus-Checked: Checked by ClamAV on apache.org --00151758f4227d132904cee1a9c7 Content-Type: text/plain; charset=ISO-8859-1 HTTPSampler1 +Regex Post Processor to extract out location header into variable +BSH post processor - read port put in defaults etc if needed HTTPSampler2 ${url}, ${port} regards deepak On Mon, Nov 19, 2012 at 3:31 PM, David Luu wrote: > But how do you use dynamic value for port if you get port value from > redirect? Right now it's 443, but it's possible that could change in the > future. As Scott mentioned, you could extract from headers but that would > make it two requests to work? > > Assuming the port won't change from 443, I assume you could do a dynamic > condition if/else check if protocol is HTTP vs HTTPS and if the latter, set > to port 443 otherwise 80, but how would you write that? And would that only > work for original request or will it also do a 2nd lookup/check against the > new redirected URL when original request is made? > > On Mon, Nov 19, 2012 at 2:48 PM, Deepak Shetty wrote: > > > two samplers arent needed - you could use dynamic values in the port > field > > (not tested in latest versions) > > > > ${__property(run.server.port,,80)} > > > > > > On Mon, Nov 19, 2012 at 2:33 PM, HUSSEY, SCOTT T wrote: > > > > > You could build two different samplers and extract the redirect from > the > > > header if the address is dynamic. > > > > > > > -----Original Message----- > > > > From: David Luu [mailto:mangaroo@gmail.com] > > > > Sent: Monday, November 19, 2012 4:27 PM > > > > To: JMeter Users List > > > > Subject: Re: How to force the port to be used in an HTTP Sampler? > > > > > > > > It's not totally clear from the original email, but I'm assuming the > > > > sampler was originally requesting an HTTP url on port 80 (specified > > > > specifically in port field or left at default). > > > > > > > > And the result of the request causes a redirect to HTTPS with > specific > > > > addition of port 443 in URL, and that the HTTP sampler simply follows > > the > > > > redirect to HTTPS at given URL but doesn't append port 443, causing > the > > > > failure. > > > > > > > > If you manually set port to 443 in the port field for the sampler, > > > wouldn't > > > > that cause the original request to change from > > > > > > > > http://originalUrl > > > > > > > > to > > > > > > > > http://originalUrl:443 > > > > > > > > which could then cause a problem w/o redirecting, because server is > > > > expecting port 80 instead at this point of the process? But of > course, > > if > > > > the original URL was already HTTPS and on 443 (default) then that > > > wouldn't > > > > be a problem. > > > > > > > > On Mon, Nov 19, 2012 at 11:11 AM, sebb wrote: > > > > > > > > > On 19 November 2012 18:18, Taoism wrote: > > > > > > Hi all, > > > > > > > > > > > > I am having an issue with a SSO system. > > > > > > > > > > > > If I do a recording following redirects at one point the system > > > sends a > > > > > > response headers with a redirect URL like so: > > > > > > > > > > > > https://domain:443/blah/SSO?qsStuff > > > > > > > > > > > > (Note the use of both https and the default 443 port in the URL). > > > > > > > > > > > > The HTTP Sampler will not add the 443 to the URL being sent to > the > > > next > > > > > > server (personally I don't think it should have to). If the port > > is > > > > > omitted > > > > > > and just https://domain/blah is used I get an Internal error > from > > > the > > > > > > server. Adding the port allows the SSO process to continue. > > > (Discovered > > > > > by > > > > > > manually copying the response redirect and pasting into a > browser). > > > > > > > > > > > > Is there any way to force the HTTP Sampler to include the port > when > > > it > > > > > makes > > > > > > the request even though it is technically redundant in this > > instance? > > > > > > > > > > Just provide the port on the sampler GUI. > > > > > > > > > > > Cheers! > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > View this message in context: > > > > > > http://jmeter.512774.n5.nabble.com/How-to-force-the-port-to-be-used- > > > > in-an-HTTP-Sampler-tp5715344.html > > > > > > Sent from the JMeter - User mailing list archive at Nabble.com. > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > > > To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org > > > > > > For additional commands, e-mail: user-help@jmeter.apache.org > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > > To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org > > > > > For additional commands, e-mail: user-help@jmeter.apache.org > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org > > > For additional commands, e-mail: user-help@jmeter.apache.org > > > > > > > > > --00151758f4227d132904cee1a9c7--