Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
d3e59eca
Commit
d3e59eca
authored
Dec 01, 2020
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
standard
parent
c44eb3af
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
websocket.ts
libs/remixd/src/websocket.ts
+3
-3
No files found.
libs/remixd/src/websocket.ts
View file @
d3e59eca
import
*
as
WS
from
'ws'
import
*
as
http
from
'http'
import
{
WebsocketOpt
,
ServiceClient
}
from
'./types'
// eslint-disable-line
import
{
WebsocketOpt
,
ServiceClient
}
from
'./types'
import
{
getDomain
}
from
'./utils'
import
{
createClient
}
from
'@remixproject/plugin-ws'
export
default
class
WebSocket
{
...
...
@@ -18,14 +18,14 @@ export default class WebSocket {
const
loopback
=
'127.0.0.1'
this
.
server
.
listen
(
this
.
port
,
loopback
,
()
=>
{
console
.
log
(
(
new
Date
())
+
' remixd is listening on '
+
loopback
+
':'
+
this
.
port
+
''
)
console
.
log
(
`
${
new
Date
()}
remixd is listening on
${
loopback
}
:
${
this
.
port
}
`
)
})
this
.
wsServer
=
new
WS
.
Server
({
server
:
this
.
server
,
verifyClient
:
(
info
,
done
)
=>
{
if
(
!
originIsAllowed
(
info
.
origin
,
this
))
{
done
(
false
)
console
.
log
(
(
new
Date
())
+
' Connection from origin '
+
info
.
origin
+
' rejected.'
)
console
.
log
(
`
${
new
Date
()}
connection from origin
${
info
.
origin
}
`
)
return
}
done
(
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