Browse Source

cookie: false

master
peter 4 years ago
parent
commit
7d88f1b910
4 changed files with 6 additions and 9 deletions
  1. 1
    1
      package.json
  2. 2
    6
      src/Frontend.ts
  3. 3
    1
      src/PromiseIO/Server.ts
  4. 0
    1
      src/Types.ts

+ 1
- 1
package.json View File

@@ -1,6 +1,6 @@
1 1
 {
2 2
   "name": "rpclibrary",
3
-  "version": "2.1.2",
3
+  "version": "2.2.0",
4 4
   "description": "rpclibrary is a websocket RPC library",
5 5
   "main": "./js/Index.js",
6 6
   "repository": {

+ 2
- 6
src/Frontend.ts View File

@@ -32,13 +32,9 @@ export class RPCSocket<Ifc extends T.RPCInterface = T.RPCInterface> implements I
32 32
      * @param server Server address
33 33
      * @param tls @default false use TLS
34 34
      */
35
-    constructor(public port:number, private server: string, private conf:T.SocketConf = { tls: false }){
35
+    constructor(public port:number, private server: string, conf:T.SocketConf = { tls: false }){
36 36
         Object.defineProperty(this, 'socket', {value: undefined, writable: true})
37
-        if(conf.tls){
38
-            this.protocol = "https:"
39
-        }else{
40
-            this.protocol = "http:"
41
-        }
37
+        this.protocol = conf.tls ? "https:" : "http:"
42 38
     }
43 39
 
44 40
     /**

+ 3
- 1
src/PromiseIO/Server.ts View File

@@ -38,7 +38,9 @@ export class PromiseIO {
38 38
     }
39 39
 
40 40
     listen(port: number) {
41
-        this.httpServer!.listen(port)
41
+        this.io!.listen(port, {
42
+            cookie: false
43
+        })
42 44
     }
43 45
 
44 46
     on(eventName: string, listener: T.AnyFunction) {

+ 0
- 1
src/Types.ts View File

@@ -72,7 +72,6 @@ export type exportT = {
72 72
     [group in string]: {}
73 73
 }
74 74
 
75
-//This probably has lots of issues
76 75
 export type RPCDefinitions<Ifc extends RPCInterface> = {
77 76
     [grp in keyof Ifc]:( { [rpc in keyof Ifc[grp]]: RPC<rpc, Ifc[grp][rpc]> }[keyof Ifc[grp]] )[]
78 77
 }

Loading…
Cancel
Save