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 11:59:21 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7265f9388327d465f49c4a76820b3134c97d7b20
7265f938
1 parent
06d9f8a2
Builds for 1 pipeline
passed
in 8 minutes 11 seconds
현재 페이지의 호스트를 사용하여 소켓 접속
Changes
1
Builds
3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
web/src/contexts/SocketContext.ts
web/src/contexts/SocketContext.ts
View file @
7265f93
import
React
from
'react'
;
import
{
io
}
from
'socket.io-client'
;
import
React
from
"react"
;
import
{
io
}
from
"socket.io-client"
;
export
const
socket
=
io
(
'http://localhost:3000/'
);
export
const
socket
=
io
(
`http://
${
window
.
location
.
hostname
}
:3000/`
);
const
SocketContext
=
React
.
createContext
(
socket
);
export
const
SocketProvider
=
SocketContext
.
Provider
;
...
...
Please
register
or
login
to post a comment