Main menu

Google Web Toolkit: Accessing hosted mode from remote machine

Yesterday I spent several hours trying to figure out a way to access the GWT hosted mode server from a remote machine. In particular, I wanted to see how my GWT application, which I developed on a Mac, will look in Internet Explorer. It seems that the embedded Jetty server (which comes with GWT hosted mode) only listens on 127.0.0.1 and localhost. After reading the Jetty documentation, searching the GWT group and the Web -- all to no avail --  I set the highest log level in GWT and started looking at the GWT source code as a last resort. It did take a while, but I finally found it: there is a new option "bindAddress" which can be passed as a program parameter in the Eclipse launch configuration. Using "-bindAddress 192.164.214.1" (or whatever is the IP address that you want to server on) will bind the Jetty instance to that address. 
As it turns out, this feature was introduced in GWT 2.0.1 (see release note). I thought I would share this in case anybody else encounters the same problem.

© 2011 Stefan Ukena.