Toggle navigation
Toggle navigation
This project
Loading...
Sign in
강동현
/
nodejs-game
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
강동현
2021-06-10 17:14:24 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
de3dded0c3a17c17cdb498060bc7a3af1e3596c8
de3dded0
1 parent
c98fafa4
express에 https적용
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
docker-compose.yml
server/Server.ts
docker-compose.yml
View file @
de3dded
...
...
@@ -8,6 +8,8 @@ services:
restart
:
unless-stopped
ports
:
-
"
3000:3000"
volumes
:
-
/etc/letsencrypt:/etc/letsencrypt
web
:
build
:
...
...
server/Server.ts
View file @
de3dded
import
express
from
"express"
;
import
socketIo
,
{
Server
as
IoServer
}
from
"socket.io"
;
import
{
createServer
}
from
"http"
;
import
{
createServer
}
from
"http
s
"
;
import
{
RoomManager
}
from
"./room/RoomManager"
;
import
{
Connection
}
from
"./connection/Connection"
;
import
{
SocketIoWrapper
}
from
"./connection/SocketWrapper"
;
import
{
readFileSync
}
from
"fs"
;
export
class
Server
{
public
readonly
port
:
number
;
...
...
@@ -13,7 +14,20 @@ export class Server {
this
.
port
=
port
;
const
app
=
express
();
const
server
=
createServer
(
app
);
const
server
=
createServer
(
{
cert
:
readFileSync
(
"/etc/letsencrypt/live/2020105578.oss2021.tk/cert.pem"
),
key
:
readFileSync
(
"/etc/letsencrypt/live/2020105578.oss2021.tk/privkey.pem"
),
ca
:
readFileSync
(
"/etc/letsencrypt/live/2020105578.oss2021.tk/fullchain.pem"
),
},
app
);
this
.
io
=
new
socketIo
.
Server
(
server
,
{
cors
:
{
origin
:
"*"
,
...
...
Please
register
or
login
to post a comment