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
 {
1
 {
2
   "name": "rpclibrary",
2
   "name": "rpclibrary",
3
-  "version": "2.1.2",
3
+  "version": "2.2.0",
4
   "description": "rpclibrary is a websocket RPC library",
4
   "description": "rpclibrary is a websocket RPC library",
5
   "main": "./js/Index.js",
5
   "main": "./js/Index.js",
6
   "repository": {
6
   "repository": {

+ 2
- 6
src/Frontend.ts View File

32
      * @param server Server address
32
      * @param server Server address
33
      * @param tls @default false use TLS
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
         Object.defineProperty(this, 'socket', {value: undefined, writable: true})
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
     }
38
     }
39
 
39
 
40
     listen(port: number) {
40
     listen(port: number) {
41
-        this.httpServer!.listen(port)
41
+        this.io!.listen(port, {
42
+            cookie: false
43
+        })
42
     }
44
     }
43
 
45
 
44
     on(eventName: string, listener: T.AnyFunction) {
46
     on(eventName: string, listener: T.AnyFunction) {

+ 0
- 1
src/Types.ts View File

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

Loading…
Cancel
Save