Skip to content

Commit 9061427

Browse files
committed
feat(installVueDevtools): support proxy auth, fixes #379
1 parent 96e1a67 commit 9061427

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/installVueDevtools/utils.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import electron, { remote } from 'electron'
22
import fs from 'fs'
3-
import path from 'path'
43
import https from 'https'
4+
import path from 'path'
55

66
export const getPath = () => {
77
const savePath = (remote || electron).app.getPath('userData')
@@ -15,6 +15,9 @@ const request = net ? net.request : https.get
1515
export const downloadFile = (from, to) =>
1616
new Promise((resolve, reject) => {
1717
const req = request(from)
18+
req.on('login', (authInfo, callback) => {
19+
callback(process.env.VUE_DEVTOOLS_PROXY_USER, process.env.VUE_DEVTOOLS_PROXY_PASSWORD)
20+
})
1821
req.on('response', res => {
1922
// Shouldn't handle redirect with `electron.net`, this is for https.get fallback
2023
if (

0 commit comments

Comments
 (0)