standardize: read user input with [key] instead of <key>; pm2 --name=* -e * -o *
This commit is contained in:
parent
e0e2c154b6
commit
c62f0211b7
@ -10,7 +10,7 @@ const my = {
|
||||
module.exports = {
|
||||
initSocket (webServer) {
|
||||
my.wsServer = new ws.Server({ server: webServer })
|
||||
console.info('Base Socket Server is initialized.')
|
||||
console.info(new Date().toJSON(), 'Base Socket Server is initialized.')
|
||||
|
||||
my.wsServer.on('connection', (socket, req) => {
|
||||
//console.info(`A socket is connecting from ${req.connection.remoteAddress}:${req.connection.remotePort}.`)
|
||||
@ -23,7 +23,7 @@ module.exports = {
|
||||
let dataObj
|
||||
try {
|
||||
dataObj = JSON.parse(data)
|
||||
console.log('收到 App Socket Event: ', dataObj?.skevent)
|
||||
console.log(new Date().toJSON(), '收到 App Socket Event: ', dataObj?.skevent)
|
||||
} catch (exception) {
|
||||
console.log(new Date().toJSON(), 'Unable to parse socket message: ', data)
|
||||
return
|
||||
@ -34,6 +34,7 @@ module.exports = {
|
||||
my.socketPool[dataObj._passtokenSource.usid] = socket
|
||||
socket.usid = dataObj._passtokenSource.usid
|
||||
console.log(
|
||||
new Date().toJSON(),
|
||||
dataObj.skevent === 'SOCKET_OWNER' ? 'Login' : 'Reconnect',
|
||||
'绑定 socket 到',
|
||||
dataObj._passtokenSource.usid,
|
||||
|
Loading…
Reference in New Issue
Block a user