From eecad004b5457f4c2e61fa0a2e42e8c1938a7550 Mon Sep 17 00:00:00 2001 From: Robert Aistleitner Date: Tue, 26 Sep 2017 16:03:23 +0200 Subject: [PATCH 1/8] allow explicitly setting the protocol from the public option --- lib/util/createDomain.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/util/createDomain.js b/lib/util/createDomain.js index df7867b4b0..44b2be1113 100644 --- a/lib/util/createDomain.js +++ b/lib/util/createDomain.js @@ -11,9 +11,13 @@ module.exports = function createDomain(options, listeningApp) { const hostname = options.useLocalIp ? internalIp.v4() : options.host; // the formatted domain (url without path) of the webpack server - return options.public ? `${protocol}://${options.public}` : url.format({ - protocol, - hostname, - port - }); + if (options.public) { + return options.public.indexOf('://') > 0 ? `${options.public}` : `${protocol}://${options.public}`; + } else { + return url.format({ + protocol, + hostname, + port + }); + } }; From 3b204ee262cf4cbba18e3c48b9901674632f7c80 Mon Sep 17 00:00:00 2001 From: Robert Aistleitner Date: Wed, 27 Sep 2017 09:54:25 +0200 Subject: [PATCH 2/8] add feedback from PR + add example + found one other glitch that auto-reload doesn't work in iframes since it tries to reload the iframe itself (which has src `about:blank`) and therefore cannot be reloaded properly. I'm now checking for protocol `about:` and traverse upwards until a reloadable window can be found. Feedback on this fix is welcome! --- client/index.js | 11 ++++++- .../cli-public-protocol/Dockerfile.devserver | 6 ++++ examples/cli-public-protocol/Dockerfile.nginx | 6 ++++ examples/cli-public-protocol/README.md | 19 +++++++++++ examples/cli-public-protocol/app.js | 5 +++ .../cli-public-protocol/docker-compose.yml | 20 ++++++++++++ examples/cli-public-protocol/index.html | 15 +++++++++ .../cli-public-protocol/nginx-default.conf | 32 +++++++++++++++++++ .../cli-public-protocol/webpack.config.js | 12 +++++++ lib/util/createDomain.js | 17 +++++----- 10 files changed, 134 insertions(+), 9 deletions(-) create mode 100644 examples/cli-public-protocol/Dockerfile.devserver create mode 100644 examples/cli-public-protocol/Dockerfile.nginx create mode 100644 examples/cli-public-protocol/README.md create mode 100644 examples/cli-public-protocol/app.js create mode 100644 examples/cli-public-protocol/docker-compose.yml create mode 100644 examples/cli-public-protocol/index.html create mode 100644 examples/cli-public-protocol/nginx-default.conf create mode 100644 examples/cli-public-protocol/webpack.config.js diff --git a/client/index.js b/client/index.js index 60d6c8bb14..6473fa6a13 100644 --- a/client/index.js +++ b/client/index.js @@ -219,6 +219,15 @@ function reloadApp() { } } else { log.info('[WDS] App updated. Reloading...'); - self.location.reload(); + let rootWindow = self; + // use parent window for reload (in case we're in an iframe with no valid src) + do { + if (rootWindow.location.protocol !== 'about:') { + break; + } + rootWindow = self.parent; + } while (rootWindow.parent !== self.parent); + + rootWindow.location.reload(); } } diff --git a/examples/cli-public-protocol/Dockerfile.devserver b/examples/cli-public-protocol/Dockerfile.devserver new file mode 100644 index 0000000000..b7139a7f11 --- /dev/null +++ b/examples/cli-public-protocol/Dockerfile.devserver @@ -0,0 +1,6 @@ +FROM node:6 + +EXPOSE 80 + +VOLUME /devserver +WORKDIR /devserver/examples/cli-public-protocol diff --git a/examples/cli-public-protocol/Dockerfile.nginx b/examples/cli-public-protocol/Dockerfile.nginx new file mode 100644 index 0000000000..03bf54bcc3 --- /dev/null +++ b/examples/cli-public-protocol/Dockerfile.nginx @@ -0,0 +1,6 @@ +FROM nginx + +COPY nginx-default.conf /etc/nginx/conf.d/default.conf + +RUN openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=localhost" && \ + openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048 diff --git a/examples/cli-public-protocol/README.md b/examples/cli-public-protocol/README.md new file mode 100644 index 0000000000..5361eaa1f4 --- /dev/null +++ b/examples/cli-public-protocol/README.md @@ -0,0 +1,19 @@ +# CLI - public protocol + +NOTE: make sure you have docker and docker-compose (at least version 2) installed and already installed all dependencies via `npm install` in the repository. + +```shell +docker-compose up +``` + +If you're manually injecting an entrypoint to an iframe, the client needs to know where to connect to the server. Since an iframe with `src="about:blank` doesn't know which protocol you're using on the outside we need to explicitly define it with the `public` option (have a look to the config provided in `webpack.config.js`). + +To be able to show how this works together with an nginx reverse proxy there's a small docker setup which does this for you. + +## What should happen + +The `docker-compose up` starts up two containers (nginx and devserver), whereas nginx is exposing port 80 and 443 (with a self-signed certificate). If you open your browser and navigate to `https://localhost` you have to accept the self-signed certificate which is - of course - not secure but ok for testing purposes. After that you can see an iframe which says `I'm sitting in the iframe and the socket connection to dev-server works!`. + +If you have a look at the network tab of the inspector you'll see that the `sockjs-node` connection is up and running. If you wouldn't specify the `https://` protocol in the `public` option, it would try to connect to the socket via `http://localhost` which would fail because the parent window is loaded via `https` and therefore violate the security rules of the browser. + +If you edit the contents of `app.js` you'll also see that auto-reloading works. diff --git a/examples/cli-public-protocol/app.js b/examples/cli-public-protocol/app.js new file mode 100644 index 0000000000..f72d974fbb --- /dev/null +++ b/examples/cli-public-protocol/app.js @@ -0,0 +1,5 @@ +'use strict'; + +var h3El = document.createElement('h3'); +h3El.innerHTML = 'I\'m sitting in the iframe asdfand the socket connection to dev-server works!'; +document.body.appendChild(h3El); diff --git a/examples/cli-public-protocol/docker-compose.yml b/examples/cli-public-protocol/docker-compose.yml new file mode 100644 index 0000000000..d0c4f6ddb5 --- /dev/null +++ b/examples/cli-public-protocol/docker-compose.yml @@ -0,0 +1,20 @@ +version: '2' + +services: + nginx: + build: + context: . + dockerfile: Dockerfile.nginx + ports: + - 80:80 + - 443:443 + links: + - devserver + + devserver: + build: + context: . + dockerfile: Dockerfile.devserver + volumes: + - ../../:/devserver + command: 'node /devserver/bin/webpack-dev-server.js' diff --git a/examples/cli-public-protocol/index.html b/examples/cli-public-protocol/index.html new file mode 100644 index 0000000000..320d7cda60 --- /dev/null +++ b/examples/cli-public-protocol/index.html @@ -0,0 +1,15 @@ + + + + + + + + + + diff --git a/examples/cli-public-protocol/nginx-default.conf b/examples/cli-public-protocol/nginx-default.conf new file mode 100644 index 0000000000..abcbc0422a --- /dev/null +++ b/examples/cli-public-protocol/nginx-default.conf @@ -0,0 +1,32 @@ +server { + listen 80; + listen 443 ssl; + + ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt; + ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key; + + ssl_dhparam /etc/ssl/certs/dhparam.pem; + ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA'; + ssl_session_timeout 1d; + ssl_session_cache shared:SSL:50m; + ssl_stapling on; + ssl_stapling_verify on; + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + ssl_prefer_server_ciphers on; + + charset UTF-8; + + location /sockjs-node { + proxy_pass http://devserver; + + proxy_buffering off; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_read_timeout 1d; + } + + location / { + proxy_pass http://devserver; + } +} \ No newline at end of file diff --git a/examples/cli-public-protocol/webpack.config.js b/examples/cli-public-protocol/webpack.config.js new file mode 100644 index 0000000000..4019004406 --- /dev/null +++ b/examples/cli-public-protocol/webpack.config.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = { + context: __dirname, + entry: './app.js', + devServer: { + host: '0.0.0.0', + port: 80, + public: 'https://localhost', + disableHostCheck: true + } +}; diff --git a/lib/util/createDomain.js b/lib/util/createDomain.js index 44b2be1113..8549243ba6 100644 --- a/lib/util/createDomain.js +++ b/lib/util/createDomain.js @@ -10,14 +10,15 @@ module.exports = function createDomain(options, listeningApp) { const port = options.socket ? 0 : appPort; const hostname = options.useLocalIp ? internalIp.v4() : options.host; - // the formatted domain (url without path) of the webpack server + // use explicitly defined public url (prefix with protocol if not explicitly given) if (options.public) { - return options.public.indexOf('://') > 0 ? `${options.public}` : `${protocol}://${options.public}`; - } else { - return url.format({ - protocol, - hostname, - port - }); + const parsedPublicUrl = url.parse(options.public); + return parsedPublicUrl.protocol ? `${options.public}` : `${protocol}://${options.public}`; } + // the formatted domain (url without path) of the webpack server + return url.format({ + protocol, + hostname, + port + }); }; From 972825e2ba4b40488a36811d9a479c5300281518 Mon Sep 17 00:00:00 2001 From: Robert Aistleitner Date: Wed, 27 Sep 2017 10:12:27 +0200 Subject: [PATCH 3/8] fix linting issues --- examples/cli-public-protocol/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/cli-public-protocol/app.js b/examples/cli-public-protocol/app.js index f72d974fbb..d488182756 100644 --- a/examples/cli-public-protocol/app.js +++ b/examples/cli-public-protocol/app.js @@ -1,5 +1,5 @@ 'use strict'; -var h3El = document.createElement('h3'); +const h3El = document.createElement('h3'); h3El.innerHTML = 'I\'m sitting in the iframe asdfand the socket connection to dev-server works!'; document.body.appendChild(h3El); From 650182ff1043706fe4bb10605ea4c8207d3e8d17 Mon Sep 17 00:00:00 2001 From: Robert Aistleitner Date: Wed, 27 Sep 2017 11:41:33 +0200 Subject: [PATCH 4/8] provide tests for createDomain helper function + found a bug due to tests: `url.parse` doesn't properly parse a provided `public` option since it counts everything before the port colon as the protocol which is just wrong. I replaced it with a protocol regex. --- lib/util/createDomain.js | 3 +- test/Util.test.js | 90 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+), 2 deletions(-) create mode 100644 test/Util.test.js diff --git a/lib/util/createDomain.js b/lib/util/createDomain.js index 8549243ba6..00bc0ef5b7 100644 --- a/lib/util/createDomain.js +++ b/lib/util/createDomain.js @@ -12,8 +12,7 @@ module.exports = function createDomain(options, listeningApp) { // use explicitly defined public url (prefix with protocol if not explicitly given) if (options.public) { - const parsedPublicUrl = url.parse(options.public); - return parsedPublicUrl.protocol ? `${options.public}` : `${protocol}://${options.public}`; + return /^[a-zA-Z]+:\/\//.test(options.public) ? `${options.public}` : `${protocol}://${options.public}`; } // the formatted domain (url without path) of the webpack server return url.format({ diff --git a/test/Util.test.js b/test/Util.test.js new file mode 100644 index 0000000000..e96c012967 --- /dev/null +++ b/test/Util.test.js @@ -0,0 +1,90 @@ +'use strict'; + +const webpack = require('webpack'); +const internalIp = require('internal-ip'); +const Server = require('../lib/Server'); +const createDomain = require('../lib/util/createDomain'); +const config = require('./fixtures/simple-config/webpack.config'); + +describe('check utility funcitons', () => { + let compiler; + before(() => { + compiler = webpack(config); + }); + + const tests = [{ + name: 'default', + options: { + host: 'localhost', + port: 8080 + }, + expected: 'http://localhost:8080' + }, { + name: 'https', + options: { + host: 'localhost', + port: 8080, + https: true + }, + expected: 'https://localhost:8080' + }, { + name: 'override with public', + options: { + host: 'localhost', + port: 8080, + public: 'myhost.test' + }, + expected: 'http://myhost.test' + }, { + name: 'override with public (port)', + options: { + host: 'localhost', + port: 8080, + public: 'myhost.test:9090' + }, + expected: 'http://myhost.test:9090' + }, { + name: 'override with public (protocol)', + options: { + host: 'localhost', + port: 8080, + public: 'https://myhost.test' + }, + expected: 'https://myhost.test' + }, { + name: 'override with public (protocol + port)', + options: { + host: 'localhost', + port: 8080, + public: 'https://myhost.test:9090' + }, + expected: 'https://myhost.test:9090' + }, { + name: 'localIp', + options: { + useLocalIp: true, + port: 8080 + }, + expected: `http://${internalIp.v4()}:8080` + }]; + + tests.forEach((t) => { + it(`test createDomain '${t.name}'`, (done) => { + const options = t.options; + const server = new Server(compiler, options); + const expected = t.expected; + server.listen(options.port, options.host, (err) => { + if (err) { + done(err); + } + const generatedDomain = createDomain(options, server.listeningApp); + if (generatedDomain !== expected) { + done(`generated domain ${generatedDomain} doesn't match expected ${expected}`); + } else { + done(); + } + server.close(); + }); + }); + }); +}); From 21c54c6bdfd51901f445b25a19b77192510a08f6 Mon Sep 17 00:00:00 2001 From: Robert Aistleitner Date: Wed, 27 Sep 2017 11:56:19 +0200 Subject: [PATCH 5/8] increase timeout for https test which exceeds default 2000ms --- test/Util.test.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/Util.test.js b/test/Util.test.js index e96c012967..e6cb1b28f6 100644 --- a/test/Util.test.js +++ b/test/Util.test.js @@ -26,7 +26,8 @@ describe('check utility funcitons', () => { port: 8080, https: true }, - expected: 'https://localhost:8080' + expected: 'https://localhost:8080', + timeout: 10000 }, { name: 'override with public', options: { @@ -69,7 +70,7 @@ describe('check utility funcitons', () => { }]; tests.forEach((t) => { - it(`test createDomain '${t.name}'`, (done) => { + const itInstance = it(`test createDomain '${t.name}'`, (done) => { const options = t.options; const server = new Server(compiler, options); const expected = t.expected; @@ -86,5 +87,8 @@ describe('check utility funcitons', () => { server.close(); }); }); + if (t.timeout) { + itInstance.timeout(t.timeout); + } }); }); From 9e6b27270358483efb1ad6bbb25036848107174f Mon Sep 17 00:00:00 2001 From: Robert Aistleitner Date: Thu, 28 Sep 2017 10:54:29 +0200 Subject: [PATCH 6/8] move info log to the place where the reload happens --- client/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/index.js b/client/index.js index 6473fa6a13..8f7da5574e 100644 --- a/client/index.js +++ b/client/index.js @@ -218,7 +218,6 @@ function reloadApp() { self.postMessage('webpackHotUpdate' + currentHash, '*'); } } else { - log.info('[WDS] App updated. Reloading...'); let rootWindow = self; // use parent window for reload (in case we're in an iframe with no valid src) do { @@ -228,6 +227,7 @@ function reloadApp() { rootWindow = self.parent; } while (rootWindow.parent !== self.parent); + log.info('[WDS] App updated. Reloading...'); rootWindow.location.reload(); } } From cfdb070f75b458bf878c19af7fd691448889a8d6 Mon Sep 17 00:00:00 2001 From: Robert Aistleitner Date: Fri, 6 Oct 2017 13:03:52 +0200 Subject: [PATCH 7/8] apply feedback * remove docker stuff from examples (minimize example) * use setInterval and clearInterval instead of do while loop when getting root window for reload --- client/index.js | 17 +++++++--- .../cli-public-protocol/Dockerfile.devserver | 6 ---- examples/cli-public-protocol/Dockerfile.nginx | 6 ---- examples/cli-public-protocol/README.md | 14 +++----- examples/cli-public-protocol/app.js | 6 ++-- .../cli-public-protocol/docker-compose.yml | 20 ------------ examples/cli-public-protocol/index.html | 9 +----- .../cli-public-protocol/nginx-default.conf | 32 ------------------- .../cli-public-protocol/webpack.config.js | 3 +- 9 files changed, 22 insertions(+), 91 deletions(-) delete mode 100644 examples/cli-public-protocol/Dockerfile.devserver delete mode 100644 examples/cli-public-protocol/Dockerfile.nginx delete mode 100644 examples/cli-public-protocol/docker-compose.yml delete mode 100644 examples/cli-public-protocol/nginx-default.conf diff --git a/client/index.js b/client/index.js index 8f7da5574e..ccc7ce62d5 100644 --- a/client/index.js +++ b/client/index.js @@ -220,13 +220,22 @@ function reloadApp() { } else { let rootWindow = self; // use parent window for reload (in case we're in an iframe with no valid src) - do { + const intervalId = self.setInterval(function findRootWindow() { if (rootWindow.location.protocol !== 'about:') { - break; + // reload immediately if protocol is valid + applyReload(rootWindow, intervalId); + } else { + rootWindow = rootWindow.parent; + if (rootWindow.parent === rootWindow) { + // if parent equals current window we've reached the root which would continue forever, so trigger a reload anyways + applyReload(rootWindow, intervalId); + } } - rootWindow = self.parent; - } while (rootWindow.parent !== self.parent); + }); + } + function applyReload(rootWindow, intervalId) { + clearInterval(intervalId); log.info('[WDS] App updated. Reloading...'); rootWindow.location.reload(); } diff --git a/examples/cli-public-protocol/Dockerfile.devserver b/examples/cli-public-protocol/Dockerfile.devserver deleted file mode 100644 index b7139a7f11..0000000000 --- a/examples/cli-public-protocol/Dockerfile.devserver +++ /dev/null @@ -1,6 +0,0 @@ -FROM node:6 - -EXPOSE 80 - -VOLUME /devserver -WORKDIR /devserver/examples/cli-public-protocol diff --git a/examples/cli-public-protocol/Dockerfile.nginx b/examples/cli-public-protocol/Dockerfile.nginx deleted file mode 100644 index 03bf54bcc3..0000000000 --- a/examples/cli-public-protocol/Dockerfile.nginx +++ /dev/null @@ -1,6 +0,0 @@ -FROM nginx - -COPY nginx-default.conf /etc/nginx/conf.d/default.conf - -RUN openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=localhost" && \ - openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048 diff --git a/examples/cli-public-protocol/README.md b/examples/cli-public-protocol/README.md index 5361eaa1f4..bae3f9981f 100644 --- a/examples/cli-public-protocol/README.md +++ b/examples/cli-public-protocol/README.md @@ -1,19 +1,13 @@ # CLI - public protocol -NOTE: make sure you have docker and docker-compose (at least version 2) installed and already installed all dependencies via `npm install` in the repository. +NOTE: replace `` with your local ip. ```shell -docker-compose up +node ../../bin/webpack-dev-server.js ``` -If you're manually injecting an entrypoint to an iframe, the client needs to know where to connect to the server. Since an iframe with `src="about:blank` doesn't know which protocol you're using on the outside we need to explicitly define it with the `public` option (have a look to the config provided in `webpack.config.js`). - -To be able to show how this works together with an nginx reverse proxy there's a small docker setup which does this for you. +You're now able to explicitly define the protocol used with the `public` option (have a look to the config provided in `webpack.config.js`). ## What should happen -The `docker-compose up` starts up two containers (nginx and devserver), whereas nginx is exposing port 80 and 443 (with a self-signed certificate). If you open your browser and navigate to `https://localhost` you have to accept the self-signed certificate which is - of course - not secure but ok for testing purposes. After that you can see an iframe which says `I'm sitting in the iframe and the socket connection to dev-server works!`. - -If you have a look at the network tab of the inspector you'll see that the `sockjs-node` connection is up and running. If you wouldn't specify the `https://` protocol in the `public` option, it would try to connect to the socket via `http://localhost` which would fail because the parent window is loaded via `https` and therefore violate the security rules of the browser. - -If you edit the contents of `app.js` you'll also see that auto-reloading works. +If you open your browser at `http://localhost:8080` you'll see that dev-server tries to establish a connection to `/sockjs-node` via the explicitly defined `https://localhost:8080`. This fails of course since we're not hosting https. diff --git a/examples/cli-public-protocol/app.js b/examples/cli-public-protocol/app.js index d488182756..ea0ccbbd43 100644 --- a/examples/cli-public-protocol/app.js +++ b/examples/cli-public-protocol/app.js @@ -1,5 +1,5 @@ 'use strict'; -const h3El = document.createElement('h3'); -h3El.innerHTML = 'I\'m sitting in the iframe asdfand the socket connection to dev-server works!'; -document.body.appendChild(h3El); +document.open(); +document.write('Please check the sockjs-info request in your dev-tools, it should try to connect to the protocol + server defined in the public setting.'); +document.close(); diff --git a/examples/cli-public-protocol/docker-compose.yml b/examples/cli-public-protocol/docker-compose.yml deleted file mode 100644 index d0c4f6ddb5..0000000000 --- a/examples/cli-public-protocol/docker-compose.yml +++ /dev/null @@ -1,20 +0,0 @@ -version: '2' - -services: - nginx: - build: - context: . - dockerfile: Dockerfile.nginx - ports: - - 80:80 - - 443:443 - links: - - devserver - - devserver: - build: - context: . - dockerfile: Dockerfile.devserver - volumes: - - ../../:/devserver - command: 'node /devserver/bin/webpack-dev-server.js' diff --git a/examples/cli-public-protocol/index.html b/examples/cli-public-protocol/index.html index 320d7cda60..3186011efe 100644 --- a/examples/cli-public-protocol/index.html +++ b/examples/cli-public-protocol/index.html @@ -1,15 +1,8 @@ + - - - diff --git a/examples/cli-public-protocol/nginx-default.conf b/examples/cli-public-protocol/nginx-default.conf deleted file mode 100644 index abcbc0422a..0000000000 --- a/examples/cli-public-protocol/nginx-default.conf +++ /dev/null @@ -1,32 +0,0 @@ -server { - listen 80; - listen 443 ssl; - - ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt; - ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key; - - ssl_dhparam /etc/ssl/certs/dhparam.pem; - ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA'; - ssl_session_timeout 1d; - ssl_session_cache shared:SSL:50m; - ssl_stapling on; - ssl_stapling_verify on; - ssl_protocols TLSv1 TLSv1.1 TLSv1.2; - ssl_prefer_server_ciphers on; - - charset UTF-8; - - location /sockjs-node { - proxy_pass http://devserver; - - proxy_buffering off; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_read_timeout 1d; - } - - location / { - proxy_pass http://devserver; - } -} \ No newline at end of file diff --git a/examples/cli-public-protocol/webpack.config.js b/examples/cli-public-protocol/webpack.config.js index 4019004406..5b368e59ab 100644 --- a/examples/cli-public-protocol/webpack.config.js +++ b/examples/cli-public-protocol/webpack.config.js @@ -5,8 +5,7 @@ module.exports = { entry: './app.js', devServer: { host: '0.0.0.0', - port: 80, - public: 'https://localhost', + public: 'https://localhost:8080', disableHostCheck: true } }; From f481d0f7da3885912ba93a9fd7c8f9b20b3b0e74 Mon Sep 17 00:00:00 2001 From: Robert Aistleitner Date: Fri, 6 Oct 2017 13:11:29 +0200 Subject: [PATCH 8/8] increase test timeout for https to 60 seconds --- test/Util.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Util.test.js b/test/Util.test.js index e6cb1b28f6..0c37056281 100644 --- a/test/Util.test.js +++ b/test/Util.test.js @@ -27,7 +27,7 @@ describe('check utility funcitons', () => { https: true }, expected: 'https://localhost:8080', - timeout: 10000 + timeout: 60000 }, { name: 'override with public', options: {