cookie: false
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "rpclibrary",
|
||||
"version": "2.2.0",
|
||||
"version": "2.2.1",
|
||||
"description": "rpclibrary is a websocket RPC library",
|
||||
"main": "./js/Index.js",
|
||||
"repository": {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user