Allows SNICallback instead of hardcoded key/cert
This updates the previous PR https://github.com/peers/peerjs-server/pull/219/ with the current code. It solves #209, allowing ssl options to use SNICallback instead of only a hardcoded key/cert pair. @afrokick I saw you accepted a few PRs this week, any chance this once can be included too? Thanks
This commit is contained in:
parent
ef7e79f99f
commit
24cb041082
@ -48,8 +48,7 @@ function PeerServer(options: Optional<IConfig> = {}, callback?: (server: Server)
|
|||||||
let server: Server;
|
let server: Server;
|
||||||
|
|
||||||
const { ssl, ...restOptions } = newOptions;
|
const { ssl, ...restOptions } = newOptions;
|
||||||
|
if (ssl && Object.keys(ssl).length) {
|
||||||
if (ssl && ssl.key && ssl.cert) {
|
|
||||||
server = https.createServer(ssl, app);
|
server = https.createServer(ssl, app);
|
||||||
|
|
||||||
newOptions = restOptions;
|
newOptions = restOptions;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user