cookie: false
This commit is contained in:
+1
-1
@@ -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": {
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user