IIS7 URL Rewrite QuickTip: Allow Flash Gateway

We all know that ColdFusion allows Flash Remoting (AMF) communication to occur via two separate URL strings:

  • http://my.site.com/flex2gateway
  • http://my.site.com/flashservices/gateway

I recently came across the problem where the URL Rewrite rules in IIS7 were blocking both of these URLs from being passed on and correctly processed by ColdFusion. The solution is to add the following two rules to your site definition and move them both to the top of the stack, above any other rules you may have. This will effectively allow both of these URLs to process normally and stop and subsequent rules from executing if the pattern matches.

You can also edit your site definition web.config file to add the rules there:

1
2
3
4
5
6
7
8
9
10
<rule name="flashservices/gateway" stopProcessing="true">
	<match url="flashservices/gateway" />
	<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
	<action type="None" />
</rule>
<rule name="flex2gateway" patternSyntax="ExactMatch" stopProcessing="true">
	<match url="flex2gateway" />
	<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
	<action type="None" />
</rule>

Again, be sure they appear before any other rules and you should be good to go! Flash on!

Flash Remoting (AS2) in Flash CS3

I’m surprised that while any sort of remote connection classes you could want are included in the core packages of ActionScript 3.0, if you are working with ActionScript 2.0 within Flash CS3, the classes you need are still not included under a default install. I’ve lamented this fact for years as it has held true each time Macromedia/Adobe releases a new version of the IDE. There may be an excellent reason for this but I do not know what it could be.

Flash CS3 does not include the NetConnection Debugger either. I’ve found that the simplest thing to do is to use the SWC files from Flash 8 alongside the NetConnectionDebugger.swf which is launched separately. It works quite well so I’ve packaged both an FLA with the Remoting SWC components along with the NetConnectionDebugger.swf which can all be used to get around the fact that none this vital stuff is shipped along with the new authoring environment.

Remoting Components

You can also download the unpackaged classes from here.