gwtproject / gwt

GWT Open Source Project
http://www.gwtproject.org
1.51k stars 372 forks source link

Running the CodeServer with of a remote server with different IP #9446

Open branflake2267 opened 7 years ago

branflake2267 commented 7 years ago

Using the code server with launcherDir that points to a remote server with different ip will not work.

CodeServer -launcherDir /Volumes/C/inetpub/wwwroot com.example.project.Sandbox

This is because the code server will launch on ip localhost, and the SDM project.nocache.js script uses var hostName = $wnd.location.hostname; which doesn't point at the codeserver, it instead points to the remote server with port 9867. The workaround is to proxy back the requests.

Example Configuration

  1. Windows iis server on 10.211.55.18
  2. launcher directory then points to a shared network directory -launcherDir /Volumes/C/inetpub/wwwroot
  3. Then launch CodeServer -launcherDir /Volumes/C/inetpub/wwwroot com.example.project.Sandbox

screen shot 2016-10-17 at 7 32 29 pm

branflake2267 commented 7 years ago

I run into this configuration often and see it when visiting enterprise customers where they test on a VM with the apps are on a custom server configuration. This is only one issue, SSL is another. I'm going to look at writing a hack for this.

branflake2267 commented 7 years ago

https://github.com/gwt-plugins/gwt-eclipse-plugin/issues/274

branflake2267 commented 7 years ago

Incomplete proposed patch: https://gwt-review.googlesource.com/#/c/17180/

branflake2267 commented 7 years ago

I take that back, the above patch should work correctly.

branflake2267 commented 7 years ago

https://github.com/gwt-plugins/codeserver/blob/master/codeserver/src/main/java/com/google/gwt/dev/codeserver/LauncherDir.java#L127 - I used this for prototyping.