mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-08 11:30:12 +08:00
fix
This commit is contained in:
1 parent
dee7e6975e
commit
6e0682881b
1 file changed
+6
-13
@@ -4,19 +4,12 @@ import Session from '../models/session.js'
|
|||||||
import { defaultUser, genSessionJWT } from '../utils/auth.js'
|
import { defaultUser, genSessionJWT } from '../utils/auth.js'
|
||||||
|
|
||||||
export default (server) => {
|
export default (server) => {
|
||||||
const io = new Server(
|
const io = new Server(server, {
|
||||||
server,
|
cors: {
|
||||||
{
|
origin: '*',
|
||||||
cors: {
|
|
||||||
origin: '*',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
})
|
||||||
cors: {
|
|
||||||
origin: '*',
|
|
||||||
},
|
|
||||||
}
|
|
||||||
)
|
|
||||||
io.use(async (socket, next) => {
|
io.use(async (socket, next) => {
|
||||||
console.log('Authenticating...')
|
console.log('Authenticating...')
|
||||||
try {
|
try {
|
||||||
@@ -61,7 +54,7 @@ export default (server) => {
|
|||||||
const stream = await attachContainer(container, { token })
|
const stream = await attachContainer(container, { token })
|
||||||
|
|
||||||
stream.on('data', (chunk) => {
|
stream.on('data', (chunk) => {
|
||||||
socket.send(chunk.toString().toString())
|
socket.send(chunk.toString())
|
||||||
})
|
})
|
||||||
|
|
||||||
socket.on('message', function incoming(message) {
|
socket.on('message', function incoming(message) {
|
||||||
|
|||||||
Reference in new issue
Block a user