Showing
4 changed files
with
0 additions
and
63 deletions
ssl/.vscode/launch.json
deleted
100644 → 0
1 | -{ | ||
2 | - // IntelliSense를 사용하여 가능한 특성에 대해 알아보세요. | ||
3 | - // 기존 특성에 대한 설명을 보려면 가리킵니다. | ||
4 | - // 자세한 내용을 보려면 https://go.microsoft.com/fwlink/?linkid=830387을(를) 방문하세요. | ||
5 | - "version": "0.2.0", | ||
6 | - "configurations": [ | ||
7 | - { | ||
8 | - "type": "pwa-node", | ||
9 | - "request": "launch", | ||
10 | - "name": "Launch Program", | ||
11 | - "skipFiles": [ | ||
12 | - "<node_internals>/**" | ||
13 | - ], | ||
14 | - "program": "${workspaceFolder}/app.js", | ||
15 | - "runtimeExecutable": "${env:HOME}/.nvm/versions/node/v16.15.0/bin/node" | ||
16 | - } | ||
17 | - ] | ||
18 | -} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
ssl/app.js
deleted
100644 → 0
1 | -const express = require('express'); | ||
2 | -const fs = require('fs'); | ||
3 | -const path = require('path'); | ||
4 | -const HTTPS = require('https'); | ||
5 | - | ||
6 | -const app = express(); | ||
7 | -// 본인이 소유한 도메인으로 변경해야 함 | ||
8 | -// www 붙여야 함 | ||
9 | -const domain = "2019102197.osschatbot2022.ml" | ||
10 | -const sslport = 23023; | ||
11 | - | ||
12 | -app.get('/', function (req, res) { | ||
13 | - res.send('Hello World'); | ||
14 | -}) | ||
15 | - | ||
16 | -try { | ||
17 | - const option = { | ||
18 | - ca: fs.readFileSync('/etc/letsencrypt/live/' + domain +'/fullchain.pem'), | ||
19 | - key: fs.readFileSync(path.resolve(process.cwd(), '/etc/letsencrypt/live/' + domain +'/privkey.pem'), 'utf8').toString(), | ||
20 | - cert: fs.readFileSync(path.resolve(process.cwd(), '/etc/letsencrypt/live/' + domain +'/cert.pem'), 'utf8').toString(), | ||
21 | - }; | ||
22 | - | ||
23 | - HTTPS.createServer(option, app).listen(sslport, () => { | ||
24 | - console.log(`[HTTPS] Server is started on port ${sslport}`); | ||
25 | - }); | ||
26 | -} catch (error) { | ||
27 | - console.log('[HTTPS] HTTPS 오류가 발생하였습니다. HTTPS 서버는 실행되지 않습니다.'); | ||
28 | - console.log(error); | ||
29 | -} | ||
30 | - |
ssl/package-lock.json
deleted
100644 → 0
This diff could not be displayed because it is too large.
ssl/package.json
deleted
100644 → 0
1 | -{ | ||
2 | - "name": "ssl", | ||
3 | - "version": "1.0.0", | ||
4 | - "description": "", | ||
5 | - "main": "app.js", | ||
6 | - "scripts": { | ||
7 | - "test": "echo \"Error: no test specified\" && exit 1" | ||
8 | - }, | ||
9 | - "author": "", | ||
10 | - "license": "ISC", | ||
11 | - "dependencies": { | ||
12 | - "express": "^4.17.1", | ||
13 | - "npm": "^8.11.0" | ||
14 | - } | ||
15 | -} |
-
Please register or login to post a comment