Archive for January, 2010

Hjælp med test af ny forside

Tuesday, January 26th, 2010

På Pirat TV bruger vi en del flash. Stort set al frontend er bygget i flash, hvilket vi i sin tid fik svenske Doberman til. Og de gjorde det rigtig godt. Desværre har det efterfølgende givet lidt bagslag, da vores egen flashmand har haft alt for travlt til at rette de småfejl vi har fundet undervejs.

Så for en uges tid siden kastede jeg mig ud i et eksperiment: At bygge Pirat TV’s forside udelukkende af god, gammeldags HTML, CSS og javascript — helt uden flash. Jeg er nu nået så langt at jeg har noget der er værd at se på. Det er ikke en færdig erstatning til forsiden. Mere et proof of concept, og jeg kunne derfor godt tænke mig at få noget feedback.

En ting der er vigtig for os, for at vi vil tage skridtet og skrælle noget flash af, er at det ikke må gå ud over brugeroplevelsen. For brugeren skal det ikke føles som en degradering at vi skifter den bagvedliggende teknologi for visningen af vores sider. Og siden er lidt tung. Både med mange billeder, men også med en god portion javascript.

Så derfor: Kig på den nuværende forside og den nye forside uden flash. Kør lidt rundt med musen på dem begge. Prøv at ændre størrelse på vinduet. Hvordan føles det? Hænger det for meget? I hvilke situationer? Prøv meget gerne i forskellige browsere. Jeg har selv testet i de fleste moderne browsere (i Windows), men har ikke haft mulighed for at prøve i en rigtig Internet Explorer 7/8. Skriv om dine observationer og hvad du synes i kommentarfeltet. Fortæl også gerne lige lidt om din computer: Hvor hurtig den er, hvor meget ram den har, hvilket styresystem du bruger, hvilke browsere du har testet i.

Det skal måske lige nævnes at de to forsider ikke er identiske helt ned på pixelniveau. Det behøver de ikke være. Endnu.

På forhånd tak.

nginx as a proxy for Visual Studio

Tuesday, January 26th, 2010

I guess most people doing ASP.NET web development in Visual Studio (VS) have been frustrated by the fact that the development server in VS only wants to serve it’s content to the local machine. It is inaccessible from other computers on the network and impossible to reach from a Virtual Machine running alternative configurations of OS/browser. This is a pain in the ass when trying to debug something not working in another version of Internet Explorer than you have on your local machine.

We’ve been trying different approaches to circumvent this, using SSH tunnels and other similar technologies, without any luck. But this morning I came up with a solution: A local HTTP proxy in front of the development server. This way, anybody can access the proxy, and still all requests to the development server are local. I chose nginx (pronounced engine x) as the proxy. It’s free, open source and it only takes a couple minutes to get up and running.

Download

Currently, the most recent version of nginx for Windows is 0.8.32, and it is available for download here. It’s a simple zip file that just needs to be extracted. No installation is needed — the server runs directly from the uncompressed files.

Configuration

In the folder conf, there’s file called nginx.conf. This is the configuration file for nginx.

Around line 36 it says:

listen 80;
server_name localhost;

80 is the port number nginx is listening to. I have personally chosen to change this to 8080, as I already have a local Apache server running on port 80. But you can pick any port number you like, as long as it’s not in use.

Around line 43 it says:

location / {
root html;
index index.html index.htm;
}

Change this to:

location / {
#root html;
#index index.html index.htm;
proxy_pass http://localhost:xxxx;
}

Where xxxx is the port on which VS is running it’s development server. This changes from project to project, and even changes from time to time in a project. So this will need to be changed once in while.

Start and reload

nginx is started by double clicking the file nginx.exe, or by opening a command prompt, cd to the nginx folder and run the command start nginx.exe. If everything is fine (i.e. if you didn’t make any mistakes in the configuration), you will hereafter have 2 new processes (a master and a worker) running, both called nginx.exe.

If you need to reconfigure nginx (e.g. change to a new port VS has chosen to run it’s server at), afterwards you can reload nginx by running the command nginx -s reload from the nginx folder in command prompt.

Read more about start, reload and stop in the official documentation.

Access

The VS development server is now available — through nginx — at http://HOSTNAME:8080, where HOSTNAME is the network name (or IP address) of your computer, and 8080 is the port you chose to let nginx listen to in the configuration.

Happy external debugging.