Skip to content

Commit

Permalink
add cert & key to pkg assets #80 #51
Browse files Browse the repository at this point in the history
  • Loading branch information
nondanee committed May 6, 2019
1 parent 0ec16c9 commit 9546a63
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
"scripts": {
"pkg": "pkg . --out-path=dist/"
},
"pkg": {
"assets": [
"server.key",
"server.crt"
]
},
"keywords": [
"netease",
"neteasemusic",
Expand Down
5 changes: 3 additions & 2 deletions server.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const fs = require('fs')
const net = require('net')
const path = require('path')
const parse = require('url').parse

const hook = require('./hook')
Expand Down Expand Up @@ -160,8 +161,8 @@ const proxy = {
}

const options = {
key: fs.readFileSync('./server.key'),
cert: fs.readFileSync('./server.crt')
key: fs.readFileSync(path.join(__dirname, 'server.key')),
cert: fs.readFileSync(path.join(__dirname, 'server.crt'))
}

const server = {
Expand Down

0 comments on commit 9546a63

Please sign in to comment.