Archive for December, 2006

2006 , top Ipod tracks…

Thursday, December 21st, 2006 by Luis

Today is the last day in the office until next year, so far 2006 has been very good, I haven’t surf yet but I had my first experience with snowboard (fantastic experience).

If everything goes as plan I’m expecting to end the year surfing in the Cantabric Sea, as I have done it every year since 1989.

Music has been the replacement of the sea whenever I felt down…

Read the rest of this entry »

Haunch of Venison

Wednesday, December 20th, 2006 by Luis

We have recently launched the new Flash site for Haunch Of Venison. It supports the use of browser back-buttons and deeplinking plus friendly Search Engine Optimization (SEO) powered by a complete content management system. An AA Accessible version and language selection are on their way too.

The site functions as a resource for the Gallery’s exhibitions (London, ZĂ¼rich, Berlin, Athens) as well as documenting the activities of the represented artists. In addition, it provides access to available works for sale, online and offline private views and books & editions.


Related Entries:

AS3 + Java: Socket connections to ports below 1024

Monday, December 11th, 2006 by Thomas

Since people started to experiment with the new Socket class in AS3 I've often read that it wouldn't be possible to connect to any port below 1024 with it. While that's true if you want to connect to any server on the web, it is possible to connect to servers that run a special socket server returning cross domain policy information to the Flash Player. It's similar to putting a cross-domain-policy file on your web server - it just requires a little more effort.

Connecting to ports below 1024 opens some interesting possibilities, like tunneling multiuser apps through port 80 to avoid being blocked by strict firewalls, writing your own mail-client, ftp-client - any network client for that matter (that doesn't need the ability to listen for incoming connections, so forget about p2p in Flash). Joa Ebert for example has written an IRC client in Flash. You could also write a Proxy on your own server to forward access to any port on any server...

This is how you can allow the AS3 Socket and XMLSocket to connect to a low port number, for example to a web server's port 80.

AS3 commands

Whenever you call the connect method of a Socket class in AS3:

Actionscript:
  1. socket = new Socket();
  2. socket.connect("localhost", 80);


... the Flash Player implicitly opens a socket - in the example above to port 80 - and sends the following character sequence:

XML:
  1. <policy-file-request/>


If the server responds with a string formatted as a common policy xml file, Flash Player will open the real socket and will fire the Event.CONNECT event. If no policy string is returned the connection will fail.

XML:
  1. <?xml version="1.0"?><cross-domain-policy><allow-access-from domain="*" to-ports="80" /></cross-domain-policy>


Now you probably don't want to modify the source code of your preferred open source webserver to make it answer to Flash Player's policy requests. Luckily there is an AS3 command to make Flash connect to another port when looking for the policy:

Actionscript:
  1. Security.loadPolicyFile("xmlsocket://localhost:1008");


This will cause the Flash Player to open a socket to port 1008, send the policy-request and read the policy file. If access is allowed it'll open the desired Socket connection to port 80 without further delay.

It is important to know that only policy-files read from a port below 1024 can grant access to ports below 1024. If your policy file is served from a port, say 8008, access below 1024 is blocked even though the policy file might say differently.

Curious - Adobe's DTD defining the structure of a policy file doesn't mention the to-ports attribute, but the Flash Player definitely reads it.

Java socket server

I wrote a little Java-class that, when started, runs as a policy server. By default it listens on port 1008, allowing connections to any port. Which is good for testing but should be changed when running it publicly!

You can download the source code here, or a runnable jar-file here. Just install the Java-Runtime-Environment (you probably already have it) and on the command line type java -jar policyserver.jar.

Flex example client

I've also written a little example AS3/Flex application that connects to the localhost web-server, sends an HTTP GET command and reads the response including HTTP headers from the webserver. You could call it a browser ;) - unfortunately it only let's you connect to servers that have the policy server running.

You can download the source code here (just import it into a Flex project and mark WebReader.as as the Default Application).

Or view an example here - enter a path starting with "/" and click on connect and see what it reads from our blog webserver...

Nintendo Flash Game: Mission in Snowdriftland

Monday, December 11th, 2006 by Carsten Schneider

An advent calendar from Nintendo, developed by extra tonic. Behind every door waits a level of cute Flash platformer "Mission in Snowdriftland".

Found on Aeropause.