<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>LogikDevelopment &#187; proxy</title>
	<atom:link href="http://www.logikdev.com/tag/proxy/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.logikdev.com</link>
	<description>&#34;Il n&#039;y a pas de problème, il n&#039;y a que des solutions. L&#039;esprit de l&#039;homme invente ensuite le problème.&#34; André Gide</description>
	<lastBuildDate>Tue, 20 Dec 2011 12:25:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Use ServerXMLHTTP through a proxy</title>
		<link>http://www.logikdev.com/2010/07/07/use-serverxmlhttp-through-proxy/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=use-serverxmlhttp-through-proxy</link>
		<comments>http://www.logikdev.com/2010/07/07/use-serverxmlhttp-through-proxy/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 19:22:17 +0000</pubDate>
		<dc:creator>smoreau</dc:creator>
				<category><![CDATA[Tricks]]></category>
		<category><![CDATA[VBScript]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[proxycfg tool]]></category>
		<category><![CDATA[ServerXMLHTTP]]></category>

		<guid isPermaLink="false">http://www.logikdev.com/?p=647</guid>
		<description><![CDATA[The other day, I was trying to use the ServerXMLHTTP object. For information, this object was created to allow you to establish server-to-server HTTP connections. The code I firstly wrote looked like the following: with sURL the URL to call and sParams the parameters to send with the URL. The problem was that oXMLHTTP.responseText didn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>The other day, I was trying to use the <strong>ServerXMLHTTP</strong> object. For information, this object was created to allow you to establish server-to-server HTTP connections.</p>
<p>The code I firstly wrote looked like the following:</p>
<pre class="brush: vb; title: ; notranslate">
Dim oXMLHTTP
Set oXMLHTTP = Server.CreateObject(&quot;MSXML2.ServerXMLHTTP&quot;)
oXMLHTTP.open &quot;POST&quot;, sURL, false
oXMLHTTP.setRequestHeader &quot;Content-Type&quot;, &quot;application/x-www-form-urlencoded&quot;
oXMLHTTP.send sParams
Response.Write oXMLHTTP.responseText
</pre>
<p>with <code>sURL</code> the URL to call and <code>sParams</code> the parameters to send with the URL.</p>
<p>The problem was that <code>oXMLHTTP.responseText</code> didn&#8217;t return anything. Or to be exact, it returned an empty string, which was obviously not the expected response&#8230; <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>After some investigation, it appeared that the problem was because the server was seating behind a proxy. All this is good and well, but the question now is how to tell the application to use the proxy?<br />
<br/><br />
First of all, the ServerXMLHTTP object has a <code>setProxy</code> method:<br />
<a href="http://msdn.microsoft.com/en-us/library/ms760236(v=VS.85).aspx">http://msdn.microsoft.com/en-us/library/ms760236(v=VS.85).aspx</a><br />
So I tried to add the following line to the previous code:</p>
<pre class="brush: vb; title: ; notranslate">
oXMLHTTP.setProxy 2, &quot;myProxyServer:80&quot;, &quot;&quot;
</pre>
<p>Unfortunately, this didn&#8217;t fix the problem. It looks like this line is simply ignored. If somebody knows why, please tell me! <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
<br/><br />
So the solution I finally adopted was to configure the proxy through the <strong>proxycfg</strong> tool.<br />
There are two ways of using this tool:</p>
<ul>
<li>Import the proxy settings from the current user&#8217;s Microsoft Internet Explorer manual settings using the command <code>proxycfg.exe -u</code></li>
<li>Configure the proxy settings manually using the command <code>proxycfg -p myProxyServer:80</code></li>
</ul>
<p>This last solution works for me and I hope it will help a few people. <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<br/><br />
<strong>PS:</strong> I found the following page when writing this article: <a href="http://support.microsoft.com/kb/289481/">http://support.microsoft.com/kb/289481/</a>. It would have been so good to find it during my investigation but anyway.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.logikdev.com/2010/07/07/use-serverxmlhttp-through-proxy/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

