Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
game-server-flip-jump
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Gia Vương
game-server-flip-jump
Commits
e409da78
Commit
e409da78
authored
Aug 19, 2025
by
Vũ Gia Vương
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
log origin
parent
2030735c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
index.js
dist/index.js
+2
-1
index.ts
src/index.ts
+2
-1
No files found.
dist/index.js
View file @
e409da78
...
@@ -14,6 +14,7 @@ const io = new socket_io_1.Server(server, {
...
@@ -14,6 +14,7 @@ const io = new socket_io_1.Server(server, {
cors
:
{
cors
:
{
methods
:
[
"GET"
,
"POST"
],
methods
:
[
"GET"
,
"POST"
],
origin
:
(
origin
,
callback
)
=>
{
origin
:
(
origin
,
callback
)
=>
{
console
.
log
(
'origin'
,
origin
);
const
allowed
=
[
const
allowed
=
[
"https://play.gamee.vn"
,
"https://play.gamee.vn"
,
"https://dev.gamee.vn"
,
"https://dev.gamee.vn"
,
...
@@ -26,7 +27,7 @@ const io = new socket_io_1.Server(server, {
...
@@ -26,7 +27,7 @@ const io = new socket_io_1.Server(server, {
callback
(
new
Error
(
"Not allowed by CORS"
));
callback
(
new
Error
(
"Not allowed by CORS"
));
}
}
},
},
credentials
:
true
,
//
credentials: true,
}
}
});
});
(
0
,
socket_1
.
setupSocket
)(
io
);
(
0
,
socket_1
.
setupSocket
)(
io
);
...
...
src/index.ts
View file @
e409da78
...
@@ -11,6 +11,7 @@ const io = new Server(server, {
...
@@ -11,6 +11,7 @@ const io = new Server(server, {
cors
:
{
cors
:
{
methods
:
[
"GET"
,
"POST"
],
methods
:
[
"GET"
,
"POST"
],
origin
:
(
origin
,
callback
)
=>
{
origin
:
(
origin
,
callback
)
=>
{
console
.
log
(
'origin'
,
origin
)
const
allowed
=
[
const
allowed
=
[
"https://play.gamee.vn"
,
"https://play.gamee.vn"
,
"https://dev.gamee.vn"
,
"https://dev.gamee.vn"
,
...
@@ -22,7 +23,7 @@ const io = new Server(server, {
...
@@ -22,7 +23,7 @@ const io = new Server(server, {
callback
(
new
Error
(
"Not allowed by CORS"
));
callback
(
new
Error
(
"Not allowed by CORS"
));
}
}
},
},
credentials
:
true
,
//
credentials: true,
}
}
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment