playframework/play — pull request #493 by bplawler (2012-03-28 05:14:14+00:00)
Title: [#1441] The DBPlugin does not support non-localhost development... 

(NOTE: I have been bouncing back and forth with mbknor on this one because I am somewhat git-challenged. I think now that I have gone through the proper steps to set up the branch, so merging the actual fix for the problem will hopefully be trivial...)

For situations where you are not developing on localhost (e.g. play is runnign on a local VM that you are accessing from your host machine) detect that a request for @db has come in from a host other than localhost and start up the h2 database with the correct options to allow a connection from a different machine, then redirect to the correct domain.

I ran into this situation while running my Play instance in an Ubuntu VM on my Mac. The fix is pretty insignificant and only affects applications running in dev mode.

Framework version: Play 1.2.4

Platform you're using: Ubuntu (on VirtualBox on my Mac)

Reproduction steps: Got to :9000/@db, you'll be redirected to localhost:8082 which won't work because Play is running on the vm!