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
feat(core, cli): builtin support of https and unix sockets #3831
Merged
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
18e9ed4
add https capabilities to dev server by adding `https` in nuxt config.
45f4150
fix(package.json): upgrade vue-loader from 13.7.0 to ^13.7.2 for pret…
5b7e27a
chore(release): upgrade nuxt from 1.4.0 to 1.4.1
53db419
Merge branch 'dev' into 146-enable-https-for-dev
Atinux 90bd6c3
fix: upgrade vue for fixing ssr vulnerability
clarkdo 376dd35
1.4.2
Atinux 8828878
Add options in CLI to enable UNIX sockets
Xowap d425f8a
fix: conflicts
galvez c35e956
Fix flag
galvez 3d4931a
unix -> socket in getLatestHost
galvez 8e7fbda
missing socket param
galvez 80e7fa2
unix->socket
galvez 25b6042
unix->socket (2)
galvez 53e16f9
lint
galvez 2f6e4a3
fix: https conflicts
galvez 54ee545
missing appServer def
galvez 9e2c360
lint
galvez 2d34211
Move options to server.https, patch nuxt-dev
galvez 4d151b1
Patch nuxt-dev (2)
galvez b51b9a6
lint
galvez 27d6ad6
Added self-signed fixture certs
galvez 25b4be4
Add https/nuxt.config.js
galvez e736d62
Fix args
galvez 70b979b
Added https/sockets fixtures
galvez af951e3
Pickup socket from server.socket if defined
galvez 08e378b
Add https/sockets unit tests
galvez 3a70ea5
lint
galvez 2c08d13
lint
galvez 0ddafeb
Skip sockets test in appveyor
galvez 39d7e4a
Merge branch 'dev' into sockets-and-https
pi0 25718f9
add missing NUXT_* env vars
galvez 7e6122f
Merge branch 'sockets-and-https' of github.com:nuxt/nuxt.js into sock…
galvez 9423fcc
Merge branch 'dev' into sockets-and-https
pi0 File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { buildFixture } from '../../utils/build' | ||
|
||
buildFixture('https') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import fs from 'fs' | ||
import path from 'path' | ||
|
||
export default { | ||
server: { | ||
https: { | ||
key: fs.readFileSync(path.resolve(__dirname, 'server.key')), | ||
cert: fs.readFileSync(path.resolve(__dirname, 'server.crt')) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<template> | ||
<h1>Served over HTTPS!</h1> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MIIDIjCCAougAwIBAgIJALww5SutcTujMA0GCSqGSIb3DQEBCwUAMGoxCzAJBgNV | ||
BAYTAkJSMRIwEAYDVQQIEwlTYW8gUGF1bG8xETAPBgNVBAcTCEJhcnJldG9zMQ0w | ||
CwYDVQQKEwROdXh0MREwDwYDVQQLEwhGaXh0dXJlczESMBAGA1UEAxMJbG9jYWxo | ||
b3N0MB4XDTE4MDkwMTIzMTk0OVoXDTE4MTAwMTIzMTk0OVowajELMAkGA1UEBhMC | ||
QlIxEjAQBgNVBAgTCVNhbyBQYXVsbzERMA8GA1UEBxMIQmFycmV0b3MxDTALBgNV | ||
BAoTBE51eHQxETAPBgNVBAsTCEZpeHR1cmVzMRIwEAYDVQQDEwlsb2NhbGhvc3Qw | ||
gZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALoFJlquH9KNTPS3E0jbdKWLVw+N | ||
oQaV+yPGPJb/IEAtg2cgMy62UlBS8eMTnMAv6JntuSuqS9wWdrvrTvcJkbbCRnKp | ||
P13OTPpzhXO8R9pgzsopaO0DfLM8mTpFi1UPhzRm5riRCVIcg/KYH5JybI7LVzVu | ||
v6LT3DhOtqp3tufRAgMBAAGjgc8wgcwwHQYDVR0OBBYEFIHCFtBMyB2w+os85zPR | ||
AkI05z4FMIGcBgNVHSMEgZQwgZGAFIHCFtBMyB2w+os85zPRAkI05z4FoW6kbDBq | ||
MQswCQYDVQQGEwJCUjESMBAGA1UECBMJU2FvIFBhdWxvMREwDwYDVQQHEwhCYXJy | ||
ZXRvczENMAsGA1UEChMETnV4dDERMA8GA1UECxMIRml4dHVyZXMxEjAQBgNVBAMT | ||
CWxvY2FsaG9zdIIJALww5SutcTujMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEL | ||
BQADgYEARaylCmK13yfaARc3utZLmD+vW7P1S4CO25skgaaQasKsKtABTURz92Ju | ||
fShBFvP6d8AQH3yvHEC2+QBUibg6tc9oT1hE1GXYczp11AvYry3hcbalB+V1vqN+ | ||
/vMAWDmg5Y0cE/QnJ8YZi2fHFoxkxJdDIfx5/w19vvE5h18IMro= | ||
-----END CERTIFICATE----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
-----BEGIN RSA PRIVATE KEY----- | ||
MIICXAIBAAKBgQC6BSZarh/SjUz0txNI23Sli1cPjaEGlfsjxjyW/yBALYNnIDMu | ||
tlJQUvHjE5zAL+iZ7bkrqkvcFna76073CZG2wkZyqT9dzkz6c4VzvEfaYM7KKWjt | ||
A3yzPJk6RYtVD4c0Zua4kQlSHIPymB+ScmyOy1c1br+i09w4Traqd7bn0QIDAQAB | ||
AoGAWZpBb0yQZ4tIllfZIi8TcOo9dXBzMAjuf7ztUo5xqnhB41rPTKDl5WsOuKKp | ||
zqlFEWBA4ZeWEt1/M+WUk8o4NU2M03Q5N7cubw2T6/q43pZkCjvdTScsP6sJgGK9 | ||
zR0o4+Owu9J5j+X9e7ChfZFVeZa3WCX6dCB17AVfUdCh7EECQQDpPdkLirOsiu5x | ||
/b42+/dLpL4gq+mnAqLzaeHI0Eb2Gt9A8RyxPicdjZGOJ3bmGZPFWcu2xUbmEsic | ||
pSbAmZujAkEAzCvBLokZ2ETJN1pZJgT3luUDmd6LsaW8BJoJ42ECM/k8ARKMJfIS | ||
/tqZPJhdkZ6JhYc36m4lNwPaY7x4Cbxl+wJBAM1WBZ6DnWppZUI1gSAm8q9FeZyJ | ||
vEmrqIlizcNcmRxQy/sASaJAdW8vEtVzKNmp6s3zH8ToKGKkZriBLHyivsECQALF | ||
zVfOcNVpCbqAtZk4lAwui//477i34XfGh7/Yv2jpR5FUKScSxINFgLM79nlVx9RS | ||
Y8YBPOwkV0DnfFHVhyUCQFYYp2B8XgghJGapOcWvp7QogkDWqCra5mrSlI+jzi5W | ||
b1LjJqCCCq4kGK6nKEzT7gd75lb2LbcUdc5JfFHbcE0= | ||
-----END RSA PRIVATE KEY----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import path from 'path' | ||
|
||
export default { | ||
server: { | ||
socket: path.resolve(__dirname, 'nuxt.socket') | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<template> | ||
<h1>Served over sockets!</h1> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { buildFixture } from '../../utils/build' | ||
|
||
buildFixture('sockets') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { loadFixture, getPort, Nuxt } from '../utils' | ||
|
||
let nuxt = null | ||
|
||
describe('basic https', () => { | ||
beforeAll(async () => { | ||
const options = await loadFixture('https') | ||
nuxt = new Nuxt(options) | ||
const port = await getPort() | ||
await nuxt.listen(port, '0.0.0.0') | ||
}) | ||
|
||
test('/', async () => { | ||
const { html } = await nuxt.renderRoute('/') | ||
expect(html.includes('<h1>Served over HTTPS!</h1>')).toBe(true) | ||
}) | ||
|
||
// Close server and ask nuxt to stop listening to file changes | ||
afterAll(async () => { | ||
await nuxt.close() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { loadFixture, Nuxt } from '../utils' | ||
|
||
let nuxt = null | ||
|
||
describe.skip.appveyor('basic sockets', () => { | ||
beforeAll(async () => { | ||
const options = await loadFixture('sockets') | ||
nuxt = new Nuxt(options) | ||
await nuxt.listen() | ||
}) | ||
|
||
test('/', async () => { | ||
const { html } = await nuxt.renderRoute('/') | ||
expect(html.includes('<h1>Served over sockets!</h1>')).toBe(true) | ||
}) | ||
|
||
// Close server and ask nuxt to stop listening to file changes | ||
afterAll(async () => { | ||
await nuxt.close() | ||
}) | ||
}) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we add it to
nuxt-dev
too?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pi0 good catch.