<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: WebTest HTTP testing</title>
	<atom:link href="http://blog.ianbicking.org/2010/04/02/webtest-http-testing/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ianbicking.org/2010/04/02/webtest-http-testing/</link>
	<description></description>
	<lastBuildDate>Fri, 06 May 2011 07:16:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Syver Enstad</title>
		<link>http://blog.ianbicking.org/2010/04/02/webtest-http-testing/comment-page-1/#comment-167190</link>
		<dc:creator>Syver Enstad</dc:creator>
		<pubDate>Fri, 09 Jul 2010 08:19:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ianbicking.org/?p=215#comment-167190</guid>
		<description>Very cool, I had to try it but discovered that on my machine it didn&#039;t work if the netloc in the url had a port specification (like this localhost:3000).

Doing this seems to work on my machine:

        parsed_url = urlparse.urlsplit(url)
        hostAndPort = parsed_url.netloc.split(&#039;:&#039;)
        extraEnviron = {
            &#039;wsgi.url_scheme&#039;: parsed_url.scheme,
            &#039;HTTP_HOST&#039;: parsed_url.netloc,
            }
        if len(hostAndPort) == 2:
            extraEnviron[&#039;SERVER_NAME&#039;], extraEnviron[&#039;SERVER_PORT&#039;] = hostAndPort
        else:
            extraEnviron[&#039;SERVER_NAME&#039;] = parsed_url.netloc
        app = TestApp(proxy_exact_request, extra_environ=extraEnviron)</description>
		<content:encoded><![CDATA[<p>Very cool, I had to try it but discovered that on my machine it didn&#8217;t work if the netloc in the url had a port specification (like this localhost:3000).</p>

<p>Doing this seems to work on my machine:</p>

<pre><code>    parsed_url = urlparse.urlsplit(url)
    hostAndPort = parsed_url.netloc.split(':')
    extraEnviron = {
        'wsgi.url_scheme': parsed_url.scheme,
        'HTTP_HOST': parsed_url.netloc,
        }
    if len(hostAndPort) == 2:
        extraEnviron['SERVER_NAME'], extraEnviron['SERVER_PORT'] = hostAndPort
    else:
        extraEnviron['SERVER_NAME'] = parsed_url.netloc
    app = TestApp(proxy_exact_request, extra_environ=extraEnviron)
</code></pre>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.390 seconds -->

