Archive for March, 2009
Sockets with JavaScript
We’ve seen a great push towards using JavaScript in modern websites, using AJAX and JSON for dynamic websites which start to feel more like applications instead of plain boring pages. One of the problems which more interactive sites face is the constant polling of the web server due to the way HTTP works. Various web apps these days tend to poll for data with the server keeping the connection alive without sending any data, once data has been sent then a new request is sent asking for more data.
One particular web app which isn’t that great is IRC web chat. Most IRC servers are keen on users connecting from their real connection, as it’s hard to track abuse when connections are being proxied by a web server. Using AJAX or JSON with a web server isn’t that ideal either, browsers have to constantly poll and refresh with the server to receive the data, this typically requires a light weight web server as Apache with PHP or Perl is hardly efficient for multiple users. The most common approaches over the years has been CGI:IRC, but this is just yet another inefficient Perl script which keeps the connection open. One of the oldest methods is using a hefty Java application, hardly friendly for users.
So, why not use sockets with JavaScript? Obviously JavaScript can’t do it directly, but with Adobe Flash and something like socketBridge (or this improved version) you could control a socket with mostly JavaScript. The only problem with Flash and sockets is that it would have to connect to a policy port before being authorised to connect to that particular port, however it would be a much lighter solution for the server compared to all the polling techniques.
I’m tempted to try and create a web IRC client using JavaScript and the Flash socket bridge. Even if other IRC networks won’t open a port for Flash policy requests, you could do something similar to the other web chat apps – use your server as a proxy.
Mar10
Forwarding all mail with Gmail
If you’ve got multiple Gmail accounts, such as different Google Apps Gmail accounts (for hosted domains) and gmail.com accounts, being able to forward them all to one account saves a lot of time and effort. Gmail does allow you to forward email under the Forwarding and POP/IMAP section of the control panel, however this only forwards non-spam emails. As most people know, sometimes the spam filters aren’t quite perfect and suffer from false positives occasionally.
To forward all mail to another account, simply remove your existing forward, create a new filter from * (matches any sender), then forward it to your main email address – making sure you’ve got Never send to spam selected. You’ll probably want to choose Delete it as well, this means any incoming mail on that specific account will be forwarded and deleted on the original account – but you’ll still have 30 days until it gets removed from trash.
This way you’ll get all mail forwarded from Gmail – including spam. Now you can see all the spam from any other Gmail accounts incase there are any false positives.