This commit is contained in:
Annie Huang authored and wancat committed 2023-08-17 19:43:55 +08:00
1 parent dee7e6975e
commit 6e0682881b
1 file changed
+6 -13
+6 -13
View File
@@ -4,19 +4,12 @@ import Session from '../models/session.js'
import { defaultUser, genSessionJWT } from '../utils/auth.js'
export default (server) => {
const io = new Server(
server,
{
cors: {
origin: '*',
},
const io = new Server(server, {
cors: {
origin: '*',
},
{
cors: {
origin: '*',
},
}
)
})
io.use(async (socket, next) => {
console.log('Authenticating...')
try {
@@ -61,7 +54,7 @@ export default (server) => {
const stream = await attachContainer(container, { token })
stream.on('data', (chunk) => {
socket.send(chunk.toString().toString())
socket.send(chunk.toString())
})
socket.on('message', function incoming(message) {