-
Notifications
You must be signed in to change notification settings - Fork 370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Super Dev Mode won't work for https pages #7535
Comments
Reported by |
Reported by |
Reported by |
Reported by |
Reported by |
Reported by |
Reported by |
Reported by |
Reported by |
Reported by |
Reported by |
Reported by |
+1 |
^ +1 |
+1 👍 , too. |
+1 |
+1 |
4 similar comments
+1 |
+1 |
+1 |
+1 |
Please stop posting +1 comments. Github now has a reactions button (the smiley icon at each comment) which contains a +1 reaction. |
Any status update on this important topic? |
To jnehlmeier ... not sure what all these emoticons are supposed to expres with regards to the issue report or the comments. Is it Thumbs up that there is an issue ? Or Thumbs up to a specific comment about it not being available in an updated release ... etc. I find this very confusing. I miss a voting possibility on bugs to give some indication how many people stumbled on the same issue. |
@dnouls If Github does not add a dedicated voting button then adding +1 to the first comment of an issues will probably become the common practice to vote for an issue on Github. On the issue overview page you can then sort issues based on reactions. |
Back to topic: |
Just to make it clear:
In other words, what kind of setup do people interested in this use? (or would like to use) and what parameters would they like to pass to SDM and how ( |
|
I guess #9277 is a duplicate also |
|
HTTPS setup GuideThe steps required now to do such a setup are:
|
FWIW, I proposed https://github.com/tbroyer/gwt-devserver to have the benefits of launcherDir without the constraint of having to somehow deploy it; using a reverse proxy (also proxying the application). You could also deploy your sourcemaps (possibly to another server) to debug a live server (http://gwtproject.org should work that way) |
Thomas,
I am sorry I read through gwt-devserver documentation and I failed to grasp it. Don't worry though this is not unusual for me :-)
I don't understand what is the primary use case. If I had to answer at gun point I would say that it is a compatibility bridge to old DevMode (http://localhost:8888) that also somehow covers the SDM case.
I don't understand its usage and its command line arguments. Looks like a wrapper around the existing CodeServer but more complicated. For me CodeServer was also difficult to grasp. I had to follow blindly a StackOverFlow post to set it up and start understanding what's going on.
and finally I can't tell if it can do what bookmarklets currently do and what is the problem with the way the bookmarklets work right now. Sure they feel somewhat hackish but I believe a certain level of setup can be expected from a developer that wants to have instant compile/debug cycle with one click in the browser in situ.
Vassilis
…On Tue, Feb 7, 2017 at 9:35 PM, Thomas Broyer ***@***.***> wrote:
FWIW, I proposed https://github.com/tbroyer/gwt-devserver to have the
benefits of launcherDir without the constraint of having to somehow deploy
it; using a reverse proxy (also proxying the application).
You could also deploy your sourcemaps (possibly to another server) to
debug a live server (http://gwtproject.org should work that way)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#7535 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AD4ROOFIxKZI8VCUFVm1pwKP_KkBwW3Cks5raMdzgaJpZM4FqFj2>
.
--
Vassilis Virvilis
|
The primary use case of gwt-devserver is to get the "CodeServer with launcherDir" behavior without the need to write any file to an output directory. This means that:
The way it works (for the first and third cases above) is by acting as a reverse proxy to your real server (either local or remote), except for This obviously doesn't cover all use cases, but at least covers some of those mentioned above. |
Thomas,
This is very helpful. Thanks a lot.
I need some time and some rereads to make sure I understand everything.
If I understand correctly the dev-server is in front of everything and
proxies to the real servers hence the complexity in the arguments. So if
you want to compile/debug something in situ (in the production site) you
fire your dev-server with the appropriate arguments (base url to proxy) and
point the developer's browser to http://localhost:xxxx - so in theory my
use case is covered.
Just to make sure can you please answer one more question: Does that hold
true for my use case explained below:
- My GWT script deployed at http[s]://myserver.com/mywidget/
- Client is allowed to use mywidget by enabling CORS at http[s]://
client.com/url <--- <script src="//
myserver.com/mywidget/mywidget.nocache.js"></script>
With bookmarklets I am able to debug easily mywidget at
http://client.com/url but not so easily (without some setup, self signed
SSL certificates etc) at https://client.com/url from my local developer
machine which doesn't have a public face to Internet. Will your proposed
scheme work with this setup?
In any case (either I got it right or not) I believe a schematic drawing
with the various use cases would be nice in order to communicate your
design more effectively.
Thanks again for your hard effort to educate me.
Vassilis
…On Wed, Feb 8, 2017 at 11:55 AM, Thomas Broyer ***@***.***> wrote:
The primary use case of gwt-devserver is to get the "CodeServer with
launcherDir" behavior without the need to write any file to an output
directory. This means that:
- you don't overwrite your "production compiled" nocache.js (this
allows easily switching between dev and production mode without the need to
recompile, and prevents some cases of broken deployment artifacts where the
SDM-generated nocache.js ends up erroneously being deployed to production)
- you can use your war source directory (e.g. src/main/webapp) without
polluting it (for standalone apps, without server side or using APIs on
another server through CORS)
- you don't need to actually deploy the SDM-generated nocache.js (this
allows working with remote servers, as is possible with bookmarklets)
The way it works (for the first and third cases above) is by acting as a
reverse proxy to your real server (either local or remote), except for
yourapp/yourapp.nocache.js which is generated on-the-fly (the same
content that CodeServer would write into the launcherDir), and /yourapp/*
URLs which are reverse-proxied to the CodeServer (launched as part of the
gwt-devserver) so you get up-to-date static assets.
This means that everything is served to your browser by http://localhost:*
URLs, and proxied to the appropriate server (local or remote); so it
"hides" the HTTPS (browser to gwt-devserver is HTTP, gwt-devserver to your
real server can be HTTP or HTTPS); and because localhost is a *secure
origin* you can use all the restricted APIs (geolocation, notifications,
etc.) without the need for HTTPS.
This obviously doesn't cover all use cases, but at least covers some of
those mentioned above.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#7535 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AD4ROHWvizgK0og6GPm7XRR0qoM5_ELkks5raZEPgaJpZM4FqFj2>
.
--
Vassilis Virvilis
|
Hmm, gwt-devserver probably wouldn't work well for that use case. |
Hmm, I personally don't care much about source maps. Sure it is nice to
have but I can work with -preety GWT compiled js.
I don't have a problem sticking with bookmarklets as long the GWT team does
not deprecate them completely.
With binding properties do you refer to window.__gwt_bookmarklet_params =
{server_url:'https://localhost:9876/',module_name:'mywidget'}; ?
Update: I wrote this mini guide that summarizes the steps required to get https to work with bookmarklets. Here it is https://vasvir.wordpress.com/2017/02/07/gwt-super-dev-mode-https-setup-in-7-steps/
…On Wed, Feb 8, 2017 at 6:00 PM, Thomas Broyer ***@***.***> wrote:
Hmm, gwt-devserver probably wouldn't work well for that use case.
I'd suggest that in this case you'd probably better debug the real
production code using source maps rather than run some dev mode against
production (or pre-production) servers. Remember that you can customize the
source maps URL (see https://github.com/gwtproject/
gwt/blob/2.8.0/user/src/com/google/gwt/core/CrossSiteIframeLinker.gwt.xml#
L27-L44) so you can make them point to a server that only you can access
(internal server or IP filtering)
That said, if bookmarklets work for you in 2.8, I see no reason to switch
(the only issue with bookmarklets IIUC is getting binding properties'
values reliably)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#7535 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AD4ROJPhxIeQWdqNIDhpBQgDUPsrGCEyks5raeadgaJpZM4FqFj2>
.
--
Vassilis Virvilis
|
I have my local appengine working with https by following eric bidelman's nginx guidance, and then subclassing the CrossSiteLinker as you kindly described above. Many thanks for that. The one remaining issue is that using SDM, whenever you visit the gwt page it auto compilrs, which recreates a new copy of the [module].nocache.js, which always reverts to an address with http. So a hack is to create a .nocache somewhere that has https and your port number and refer to that file in the .html page that loads the gwt. The gwt:run maven command picks up a server name and a port from the command-line, but always assumes http, right ? Question - is there a class we could override where we could generate a .nocache that actually contains https:// ? |
Instead of the line....
...being generated in the .nocache.js file can it not just be...
...so it uses the same protocol as the page it is loaded in? |
Hi Paul,
Even if you change the bookmarklet to https the gwt-codeserver still
doesn't speak https. So you are going a https server to proxy requests to
gwt-codeserver.
There are 7 steps to do this properly. You are jumping to step 6 with this.
Please check out my comment in the same issue you posted from or at my blog
https://vasvir.wordpress.com/2017/02/07/gwt-super-dev-mode-https-setup-in-7-steps/
which expands a bit.
GWT could eliminate the steps 4-5-6 if they wished.
…On Wed, Oct 18, 2017 at 5:14 PM, Paul French ***@***.***> wrote:
Instead of the line....
var serverUrl = 'http://' + hostName + ':<port>';
...being generated in the .nocache.js file can it not just be...
var serverUrl = '//' + hostName + ':<port>';
...so it uses the same protocol as the page it is loaded in?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#7535 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AD4RONJrIMqI4WRWLn8iIiJjvtW-S49Fks5stgfjgaJpZM4FqFj2>
.
--
Vassilis Virvilis
|
Hi Vasvir, com.google.gwt.dev.codeserver/stub.nocache.js ...to my test/src directory in my GWT project and make the amendment to the stub.nocache.js file...
I use test/src since it is part of the classpath when working in eclipse and so does not pollute the main code. Hence if the above change was made, which would still work as before for http, I would not have to make any changes to GWT. But this is only for how we work with GWT in our office internally for development, it might not be sufficient for others. Let me explain. I've setup a reverse proxy to listen on ports 443 (https) and 9997 (code server port), it simply proxies your requests back to the IP the request came from. For my proxy I've installed our company domain certificates. There is one pre-requisite, the developer must be running their local dev server (not the code server) on port 80. So get your super dev mode working in http locally by pointing your browser to your local dev server e.g. The critical parts of the apache httpd-ssl.conf file to get this to work...
The ProxyPassReverse is required for our server side application which issues http redirects. I don't think it is needed for super dev mode. Cheers |
Hi everyone, can someone please help me? I have a Spring Boot server with SSL enabled on it. I want to use GWT as GUI side of my application. But I get this:
and when I enable "load unsafe script" on Chrome I still get the followings on the console:
Can someone please explain in details how I can setup a reverse proxy in front of code server to compile the page just fine? |
For anyone having the same problem. Super dev mode doesn't support SSL. To use https, you need to use Production mode. To do so, set to \static folder of Spring Boot Project and then simply package gwt code: then just run Spring Boot to serve the static files. |
Also take a look at #7535 for
instructions on how to set https in superdev mode
…On Mon, Sep 3, 2018 at 4:19 PM pedy711 ***@***.***> wrote:
For anyone having the same problem. Super dev mode doesn't support SSL.
I debug using Super Dev Mode without SSL:
mvn gwt:codeserver -Pgwt-prod
To use https, you need to use Production mode. To do so, set to \static
folder of Spring Boot Project and then simply package gwt code:
mvn package -Pgwt-prod
then just run Spring Boot to serve the static files.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#7535 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AD4ROLxP__bBw1REvfjbdeos5j3WCSXXks5uXSxJgaJpZM4FqFj2>
.
--
Vassilis Virvilis
|
Aa sorry I sent you in a circular reference.
Here is what I had in mind
#7535 (comment)
and my blog post:
https://vasvir.wordpress.com/2017/02/07/gwt-super-dev-mode-https-setup-in-7-steps/
Hope that helps
…On Mon, Sep 3, 2018 at 4:22 PM Vassilis Virvilis ***@***.***> wrote:
Also take a look at #7535 for
instructions on how to set https in superdev mode
On Mon, Sep 3, 2018 at 4:19 PM pedy711 ***@***.***> wrote:
> For anyone having the same problem. Super dev mode doesn't support SSL.
> I debug using Super Dev Mode without SSL:
> mvn gwt:codeserver -Pgwt-prod
>
> To use https, you need to use Production mode. To do so, set to \static
> folder of Spring Boot Project and then simply package gwt code:
> mvn package -Pgwt-prod
>
> then just run Spring Boot to serve the static files.
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#7535 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AD4ROLxP__bBw1REvfjbdeos5j3WCSXXks5uXSxJgaJpZM4FqFj2>
> .
>
--
Vassilis Virvilis
--
Vassilis Virvilis
|
Super Dev Mode seems to work only on localhost, but not on IP address of the machine which makes it not discoverable in the same network. I need it to run on the IP address so that other devices can talk to it. I also tried to set up the apache server, but I am not familiar with apache server configs file. Therefore, couldn't get it working from your guide. It would have been great if you could explain the details on the Apache server config file. My Spring Boot server runs on port 8090. Can you please help me building the Apache Server config file based on that? |
In understand that is somewhat complicated. However if you want to make it
work you need to figure out the moving parts.
The main use case is that gwt-codeserver runs on localhost - your
development machine. When you lunch the bookmarklet it tries to override
the application configuration (on the user browser) and it tries to load
the code from http://localhost:9876 The code server speaks only http and
not https. So if you need to work with https you need a translation layer.
That's why we run apache at https://localhost:9877 that proxies to
https://localhost:9876 where the codeserver is. The rest of guide is about
letting gwt connect to https://localhost:9877
Now if you want to have the gwt-codeserver running on the SuperFastServer
machine instead of localhost you can play tricks with ssh tunnels. I have
done it and it works but of course it complicates things further.
The 8090 port is irrelevant and not gwt specific. This what I think but I
am not familiar with Spring Boot so I may be wrong.
Hope that helps.
…On Mon, Sep 3, 2018 at 4:42 PM pedy711 ***@***.***> wrote:
Super Dev Mode seems to work only on localhost, but not on IP address of
the machine which makes it not discoverable in the same network. I need it
to run on the IP address so that other devices can talk to it. I also tried
to set up the apache server, but I am not familiar with apache server
configs file. Therefore, couldn't get it working from your guide. It would
have been great if you could explain the details on the Apache server
config file. My Spring Boot server runs on port 8090. Can you please help
me building the Apache Server config file based on that?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#7535 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AD4ROHCwEJpYandnII1UQHmwjqaJwLK6ks5uXTG3gaJpZM4FqFj2>
.
--
Vassilis Virvilis
|
Especially with the howto of vasvir I was able to get our GWT applications running at SuperDevMode! One remark/topic which maybe related to GWT Version 2.8.2: I have no glue about the relations, but the effect may be important for other users as well ... |
So I've been struggling with this same issue, but have discovered a pretty straight-forward solution that works well for me that I wanted to share. This essentially makes use of the gwt code server, but without involving the bookmarklet. First, fire up the gwt code server like normal:
This will bring up a webserver on the local machine, where the compiled code will be served from: However, the compilation doesn't happen unless it gets triggered by an http request, but this can be done manually by hitting this URL: You can now access the compiled assets from the local webserver. In my case the URL was: The trick now is to get the browser to use the gwt assets served from the local webserver instead of the production webserver. This is where the Requestly Chrome extension comes in (https://www.requestly.in/). Using Requestly, I created a "Redirect Request Rule", and set it up with the following settings: This means I can now open up the application page running on a production server, and requests for things like: You'll be able to open Chrome Developer Tools on the Network tab and see the requests get redirected with 307's. Again, you still have to trigger the code to compile manually, but I've set up my IDE so whenever I make changes and save a file, it will ping this URL and trigger the recompile: |
Hey James,
As soon as I first noticed flutter, I decided the time has come to learn
dart and move on.
Yes, we still need Java for server side (cloud api endpoints etc), but
it'll be nice to put java to rest asap.
Thanks for the heads up though.
Ian
…On Wed, Mar 4, 2020 at 7:47 AM James Albright ***@***.***> wrote:
So I've been struggling with this same issue, but have discovered a pretty
straight-forward solution that works well for me that I wanted to share.
This essentially makes use of the gwt code server, but without involving
the bookmarklet.
First, fire up the gwt code server like normal:
$ mvn gwt:run-codeserver
This will bring up a webserver on the local machine, where the compiled
code will be served from:
http://localhost:9876/
However, the compilation doesn't happen unless it gets triggered by an
http request, but this can be done manually by hitting this URL:
http://localhost:9876/recompile/Adminui?mgwt.density=mid&mgwt.formfactor=desktop&user.agent=safari
You can now access the compiled assets from the local webserver. In my
case the URL was:
http://localhost:9876/Adminui/Adminui.nocache.js
The trick now is to get the browser to use the gwt assets served from the
local webserver instead of the production webserver. This is where the
Requestly Chrome extension comes in (https://www.requestly.in/).
Using Requestly, I created a "Redirect Request Rule", and set it up with
the following settings:
When Request [Url] [Matches (Wildcard)]:
https://testmachine.development.lab:2443/adminui/Adminui/*
Destination Url: http://localhost:9876/Adminui/$1
This means I can now open up the application page running on a production
server, and requests for things like:
https://testmachine.development.lab:2443/adminui/Adminui/Adminui.nocache.js
Get redirected to: http://localhost:9876/Adminui/Adminui.nocache.js
You'll be able to open Chrome Developer Tools on the Network tab and see
the requests get redirected with 307's.
Again, you still have to trigger the code to compile manually, but I've
set up my IDE so whenever I make changes and save a file, it will ping this
URL and trigger the recompile:
http://localhost:9876/recompile/Adminui?mgwt.density=mid&mgwt.formfactor=desktop&user.agent=safari
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#7535?email_source=notifications&email_token=AAFNLRCVO5E4E7Q4PNBKPFTRFVUFXA5CNFSM4BNILD3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENVCVTA#issuecomment-594160332>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFNLRDJBRN3UKCIPK3VMEDRFVUFXANCNFSM4BNILD3A>
.
|
I disable the HTTPS vs HTTP checks in chrome by using the following command line option: |
@jalbr74 . Thanks for sharing! But I have got a question. |
@michelcouto I didn't really do anything special to enable source maps, but I seem to have no problems opening and debugging the source code in Chrome. I assume source maps get included automatically when you run "mvn gwt:run-codeserver". Running like this, I'm able to bring up Chrome Dev Tools, and go to the "Sources" tab, use Ctrl+P to open a file, and type the name of the Java file I want to open. Then I'm able to set and hit the desired breakpoints in the Java code. Here's the configuration I'm using for the gwt-maven-plugin, but like I said, I don't think I did anything special to enable source maps:
|
Originally reported on Google Code with ID 7538
Reported by
skybrian@google.com
on 2012-07-19 23:44:00The text was updated successfully, but these errors were encountered: