소스 검색

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
brunobg 4 년 전
부모
커밋
24cb041082
1개의 변경된 파일1개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 2
      src/index.ts

+ 1 - 2
src/index.ts

@@ -48,8 +48,7 @@ function PeerServer(options: Optional<IConfig> = {}, callback?: (server: Server)
   let server: Server;
 
   const { ssl, ...restOptions } = newOptions;
-
-  if (ssl && ssl.key && ssl.cert) {
+  if (ssl && Object.keys(ssl).length) {
     server = https.createServer(ssl, app);
 
     newOptions = restOptions;