diff --git a/package.json b/package.json index 5a5baed..4a93690 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rpclibrary", - "version": "2.1.2", + "version": "2.2.0", "description": "rpclibrary is a websocket RPC library", "main": "./js/Index.js", "repository": { diff --git a/src/Frontend.ts b/src/Frontend.ts index b6665d2..0a529cc 100644 --- a/src/Frontend.ts +++ b/src/Frontend.ts @@ -32,13 +32,9 @@ export class RPCSocket implements I * @param server Server address * @param tls @default false use TLS */ - constructor(public port:number, private server: string, private conf:T.SocketConf = { tls: false }){ + constructor(public port:number, private server: string, conf:T.SocketConf = { tls: false }){ Object.defineProperty(this, 'socket', {value: undefined, writable: true}) - if(conf.tls){ - this.protocol = "https:" - }else{ - this.protocol = "http:" - } + this.protocol = conf.tls ? "https:" : "http:" } /** diff --git a/src/PromiseIO/Server.ts b/src/PromiseIO/Server.ts index 1a5cd16..9ce7d0f 100644 --- a/src/PromiseIO/Server.ts +++ b/src/PromiseIO/Server.ts @@ -38,7 +38,9 @@ export class PromiseIO { } listen(port: number) { - this.httpServer!.listen(port) + this.io!.listen(port, { + cookie: false + }) } on(eventName: string, listener: T.AnyFunction) { diff --git a/src/Types.ts b/src/Types.ts index 236ba7b..2fa590f 100644 --- a/src/Types.ts +++ b/src/Types.ts @@ -72,7 +72,6 @@ export type exportT = { [group in string]: {} } -//This probably has lots of issues export type RPCDefinitions = { [grp in keyof Ifc]:( { [rpc in keyof Ifc[grp]]: RPC }[keyof Ifc[grp]] )[] }