Archive for November, 2007
Using SSH Tunnels to develop Facebook Applications
Posted by admin in entrepreneurs on 20Nov07
One of the most frustrating things I found early on when working on facebook applications, was that there was no simple way to create a local development environment. Because so many of the features of the platform existed only when the code was executed THROUGH the facebook proxy (fbml parsing, fb:ref cache content, etc), I found myself in an almost endless cycle of “svn commit”, “svn up” on the test server. Although I could have reduced this to a single step using a capistrano deployment task, or (heavens forbid) simply edited the code in place on the server using VI, I wasn’t happy with either of these options.
By happy coincidence, I spent the day hacking away on FB apps with my friend Ben Savage, who showed me how *he* does it – he simply port forwards port 4100 on his local router into his laptop, and then sets the facebook application to use his current outside IP:4100 as the app url.
I didn’t like this for a few reasons – first, it requires admin access to the router, a no-go from Starbucks. Second, I don’t like having to change my facebook application settings every time I change offices. So I decided to try using an ssh tunnel.
After mucking about a bit, I got it working! Here’s what I had to do (and yes, it’s pretty ugly and you probably want to do this on a non-critical junk proxy box you’ve got somewhere):
Changes to /etc/ssh/sshd_config
1. You have to make the ssh connection as root in order to bind to a privileged port (it’s probably trivial to use a non-privileged port for this, but I couldn’t be bothered). So you need to enabled root logins, by adding/changing
PermitRootLogin yes
2. In order to bind to a network address other than localhost on the remote server, you need
GatewayPorts yes
Then you simply run this from console on your local machine:
ssh root@mytunnelbox.com -p22 -N -R *:8090/localhost/80
This will forward port 8090 on your remote server to port 80 on your local workstation, via ssh tunnel. I don’t usually bother to fork into the background, because it’s nice to be able to ctrl-c to finish up.
Now get into your facebook developer application (you probably want to create a test application for this), and change the Callback URL to mytunnelbox.com:8090/. (You’ll only have to do this the first time).
Voila! Local development facebook application work – from Starbucks or anywhere else!
Checkmate? MySpace, Bebo and SixApart To Join Google OpenSocial (confirmed)
Posted by admin in entrepreneurs on 01Nov07
There’s nothing like twitter to bring home the reality that, at least when it comes to news, traditional search engines are horribly obsolete. Having heard about this from @Scobleizer, I immediately checked google.com, news.google.com, even the myspace homepage. Nothing.
Google may have just come out of nowhere and checkmated Facebook in the social networking power struggle.MySpace and Six Apart will announce that they are joining Google’s OpenSocial initiative.
Checkmate? MySpace, Bebo and SixApart To Join Google OpenSocial (confirmed)
Ironically, this may be the boost that OpenID (or some better system) needs – as per my previous post on Identitu.de, a cross-site API for developers immediately raises the ugly questions of duplicate accounts, and the merging and splitting required.
Hopefully there’s a better way than what I’ve been doing on the Facebook Platform – silently creating a new BountyUp user to match the Facebook user ID.
Blogged with Flock

