cookie: false

This commit is contained in:
2020-10-23 17:28:16 +02:00
parent 7d88f1b910
commit 2b722822cf
2 changed files with 4 additions and 6 deletions
+3 -5
View File
@@ -2,7 +2,7 @@ import { Server, Socket } from "socket.io"
import { Server as httpServer } from "http"
import * as U from '../Utils'
import * as T from '../Types'
const socketio = require('socket.io')
import socketio = require('socket.io')
export class PromiseIO {
io?: Server
@@ -18,7 +18,7 @@ export class PromiseIO {
attach(httpServer: httpServer) {
this.httpServer = httpServer
this.io = socketio(httpServer)
this.io = socketio(httpServer, { cookie:false })
this.io!.on('connection', (sock: Socket) => {
const pioSock = U.makePioSocket(sock)
this.listeners['socket'].forEach(listener => listener(pioSock))
@@ -38,9 +38,7 @@ export class PromiseIO {
}
listen(port: number) {
this.io!.listen(port, {
cookie: false
})
this.httpServer!.listen(port)
}
on(eventName: string, listener: T.AnyFunction) {