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
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "rpclibrary", "name": "rpclibrary",
"version": "2.2.0", "version": "2.2.1",
"description": "rpclibrary is a websocket RPC library", "description": "rpclibrary is a websocket RPC library",
"main": "./js/Index.js", "main": "./js/Index.js",
"repository": { "repository": {
+3 -5
View File
@@ -2,7 +2,7 @@ import { Server, Socket } from "socket.io"
import { Server as httpServer } from "http" import { Server as httpServer } from "http"
import * as U from '../Utils' import * as U from '../Utils'
import * as T from '../Types' import * as T from '../Types'
const socketio = require('socket.io') import socketio = require('socket.io')
export class PromiseIO { export class PromiseIO {
io?: Server io?: Server
@@ -18,7 +18,7 @@ export class PromiseIO {
attach(httpServer: httpServer) { attach(httpServer: httpServer) {
this.httpServer = httpServer this.httpServer = httpServer
this.io = socketio(httpServer) this.io = socketio(httpServer, { cookie:false })
this.io!.on('connection', (sock: Socket) => { this.io!.on('connection', (sock: Socket) => {
const pioSock = U.makePioSocket(sock) const pioSock = U.makePioSocket(sock)
this.listeners['socket'].forEach(listener => listener(pioSock)) this.listeners['socket'].forEach(listener => listener(pioSock))
@@ -38,9 +38,7 @@ export class PromiseIO {
} }
listen(port: number) { listen(port: number) {
this.io!.listen(port, { this.httpServer!.listen(port)
cookie: false
})
} }
on(eventName: string, listener: T.AnyFunction) { on(eventName: string, listener: T.AnyFunction) {