pinokiod 3.8.149 → 3.8.150

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -119,10 +119,8 @@ class Api {
119
119
  return result
120
120
  }
121
121
  async stop(req, ondata) {
122
- console.log(">>>>>>>>>>>>>>>>>> STOP")
123
122
  // 1. set the "stop" flag for the uri, so the next execution in the queue for the uri will NOT queue another task
124
123
  // 2. stream a message closing the socket
125
- console.time("stop 1")
126
124
 
127
125
  let requestPath = this.filePath(req.params.uri)
128
126
 
@@ -132,9 +130,6 @@ class Api {
132
130
  await this.process(script.on.stop)
133
131
  }
134
132
  }
135
- console.timeEnd("stop 1")
136
-
137
- console.time("stop 2")
138
133
  // reset modules
139
134
  let modpath = this.resolvePath(cwd, req.params.uri)
140
135
  console.log("STOP modpath", modpath)
@@ -160,15 +155,11 @@ class Api {
160
155
 
161
156
  // stop all proxies
162
157
  this.stopProxy({ script: requestPath })
163
- console.timeEnd("stop 2")
164
158
 
165
159
  // stop all cloudflare tunnels
166
160
 
167
- console.time("stop 3")
168
161
  await this.kernel.stopCloudflare({ path: requestPath })
169
- console.timeEnd("stop 3")
170
162
 
171
- console.time("stop 4")
172
163
 
173
164
  // if there are any pending waiters, delete them
174
165
 
@@ -185,7 +176,6 @@ class Api {
185
176
  id: requestPath,
186
177
  type: "disconnect"
187
178
  })
188
- console.timeEnd("stop 4")
189
179
  this.kernel.refresh(true)
190
180
  return true
191
181
  }
@@ -1,7 +1,6 @@
1
1
  const path = require('path')
2
2
  class Script {
3
3
  async start(req, ondata, kernel) {
4
- console.log(">>>>>>>>> script.start", req)
5
4
  let res = await this.run(req, ondata, kernel)
6
5
  return res
7
6
  }
@@ -44,7 +43,6 @@ class Script {
44
43
  */
45
44
  // if already running, print that it's already running
46
45
  let id = kernel.api.filePath(req.params.uri, req.cwd)
47
- console.log({ id , uri: req.params.uri, cwd: req.cwd })
48
46
  if (kernel.api.running[id]) {
49
47
  let msg = `${req.params.uri} already running. Continuing...\r\n`
50
48
  ondata({ raw: msg })
@@ -79,7 +79,6 @@ class Caddy {
79
79
  ondata(e)
80
80
  })
81
81
  } else {
82
- console.log("req", req)
83
82
  ondata({
84
83
  title: "Password",
85
84
  description: "Enter your system password to add the HTTPS certificate",
@@ -90,9 +89,7 @@ class Caddy {
90
89
  placeholder: "System password",
91
90
  }]
92
91
  }, "input")
93
- console.log("Wait until", id)
94
92
  let response = await this.kernel.api.wait(id)
95
- console.log({ response })
96
93
  await this.kernel.exec({
97
94
  message: `echo ${response.password} | sudo -S caddy trust`,
98
95
  path: this.kernel.homedir
@@ -104,7 +101,6 @@ class Caddy {
104
101
  // }
105
102
  })
106
103
  }
107
- console.log("FINISHED")
108
104
  }
109
105
  async installed() {
110
106
  let e = await this.kernel.exists(this.kernel.path("cache/XDG_DATA_HOME/caddy/pki/authorities/local/root.crt"))
@@ -120,10 +120,9 @@ report_errors: false`)
120
120
  // }
121
121
  async check() {
122
122
  let res = await this.kernel.bin.exec({ message: `conda list` }, (stream) => {
123
- process.stdout.write(stream.raw)
123
+ // process.stdout.write(stream.raw)
124
124
  // console.log("conda list check", { stream })
125
125
  })
126
- console.log("2 conda list check", res)
127
126
 
128
127
  let lines = res.response.split(/[\r\n]+/)
129
128
  let conda_check = {}
@@ -179,7 +178,6 @@ report_errors: false`)
179
178
  }
180
179
  }
181
180
  }
182
- console.log("> Check", { conda_check, conda })
183
181
  this.kernel.bin.installed.conda = conda
184
182
  return conda_check.conda && conda_check.mamba && conda_check.sqlite
185
183
  //return conda_check.conda && conda_check.mamba
@@ -253,21 +251,17 @@ report_errors: false`)
253
251
  // 2. The pinned file says conda-libmamba-solver=24.11.1
254
252
  // 3. so after conda update --all, it should be conda-libmamba-solver=24.11.1
255
253
 
256
- console.log({ req })
257
-
258
-
259
254
  let mods = this.kernel.bin.mods.filter((m) => {
260
255
  return req.dependencies.includes(m.name)
261
256
  // return ["zip", "uv", "node", "huggingface", "gxx", "git", "ffmpeg", "caddy"].includes(m.name)
262
257
  }).map((m) => {
263
258
  return m.mod.cmd()
264
259
  }).join(" ")
265
- console.log("To install", { mods })
260
+ console.log("Conda dependencies to install", { mods })
266
261
 
267
262
  let cmds = [
268
263
  //"conda clean -y --index-cache",
269
264
  "conda clean -y --all",
270
- //"conda install -y -c conda-forge sqlite=3.47.2",
271
265
  `conda install -y -c conda-forge sqlite=3.47.2 ${mods}`,
272
266
 
273
267
  // `conda config --file ${this.kernel.path('condarc')} --set remote_connect_timeout_secs 20`,
@@ -381,9 +375,6 @@ report_errors: false`)
381
375
  let e
382
376
  for(let p of this.paths[this.kernel.platform]) {
383
377
  let e = await this.kernel.bin.exists(p)
384
- console.log("kernel.bin.conda.installed")
385
- console.log("e", e)
386
- console.log("correct_conda", this.kernel.bin.correct_conda)
387
378
  if (e && this.kernel.bin.correct_conda) return true
388
379
  }
389
380
  return false
@@ -345,11 +345,8 @@ class Bin {
345
345
  this.correct_conda = false
346
346
  } else {
347
347
  res = await this.exec({ message: `conda list` }, (stream) => {
348
- process.stdout.write(stream.raw)
349
348
  // console.log("conda list check", { stream })
350
349
  })
351
- console.log("1 conda list check", res)
352
-
353
350
 
354
351
  let lines = res.response.split(/[\r\n]+/)
355
352
  for(let line of lines) {
@@ -402,7 +399,6 @@ class Bin {
402
399
  }
403
400
  }
404
401
  }
405
- console.log("conda_check", conda_check)
406
402
 
407
403
  if (conda_check.conda && conda_check.mamba && conda_check.sqlite) {
408
404
  //if (conda_check.conda && conda_check.mamba) {
@@ -646,15 +642,12 @@ class Bin {
646
642
  bin: this.preset("ai")
647
643
  })
648
644
  req.params = JSON.stringify(requirements)
649
- console.log(">>>>> 1")
650
645
  if (this.install_required) {
651
- console.log(">>>>> 2")
652
646
  let res = await this.install(req, ondata)
653
647
  return res
654
648
  }
655
649
  }
656
650
  async install(req, ondata) {
657
- console.time("kernel.bin.install")
658
651
  /*
659
652
  req.params := {
660
653
  client: {
@@ -672,13 +665,7 @@ class Bin {
672
665
  } else {
673
666
  this.client = null
674
667
  }
675
-
676
- console.log("install", req)
677
-
678
668
  let requirements = JSON.parse(req.params)
679
-
680
- console.time("### Total Install")
681
-
682
669
  for(let x=0; x<10; x++) {
683
670
  console.log(`## Install Attempt ${x}`)
684
671
  let i = 0;
@@ -692,9 +679,7 @@ class Bin {
692
679
  console.log("already installed. skip.")
693
680
  } else {
694
681
  console.log("not installed. install.")
695
- console.time("############# Install " +requirement.name)
696
682
  await this.tryInstall(req.id, requirement, x, i, requirements.length, ondata)
697
- console.timeEnd("############# Install " +requirement.name)
698
683
  }
699
684
  }
700
685
 
@@ -750,12 +735,10 @@ class Bin {
750
735
  // }
751
736
  // }
752
737
  //}
753
- console.timeEnd("### Total Install")
754
738
  if (this.kernel.shell) {
755
739
  console.log(">>> shell reset")
756
740
  this.kernel.shell.reset()
757
741
  }
758
- console.timeEnd("kernel.bin.install")
759
742
  await this.init()
760
743
  }
761
744
  async check_installed(r, dependencies) {
@@ -804,35 +787,6 @@ class Bin {
804
787
  }
805
788
  requirements(config) {
806
789
  let requirements = config.bin.requirements
807
- // let requirements = [
808
- // { name: "conda", },
809
- // { name: "git", },
810
- //// { name: "zip", },
811
- // { name: "node", },
812
- // { name: "ffmpeg", },
813
- // { name: "caddy", }
814
- // ]
815
- // let platform = os.platform()
816
- // if (platform === "win32") {
817
- // requirements.push({ name: "registry" })
818
- // requirements.push({ name: "vs" })
819
- // }
820
- // if (platform === "darwin") {
821
- // requirements.push({ name: "brew" })
822
- // }
823
- // if (platform === "linux") {
824
- // requirements.push({ name: "gxx" })
825
- // }
826
- // if (this.kernel.gpu === "nvidia") {
827
- // requirements.push({ name: "cuda", })
828
- // }
829
- // requirements = requirements.concat([
830
- // { name: "cloudflared" },
831
- //// { name: "playwright" },
832
- // { name: "huggingface" },
833
- // { name: "uv" },
834
- // { name: "py" },
835
- // ])
836
790
  if (config.script && config.script.requires && config.script.requires.length > 0) {
837
791
  /*********************************************************************
838
792
 
@@ -447,7 +447,7 @@ const requirements = async (script, filepath, kernel) => {
447
447
  let env = await get2(filepath, kernel)
448
448
  for(let item of script.pre) {
449
449
  if (item.env) {
450
-
450
+ // if index is not set, use 0 as default (for key)
451
451
  if (!item.index) {
452
452
  item.index = 0
453
453
  }
@@ -464,7 +464,21 @@ const requirements = async (script, filepath, kernel) => {
464
464
  item.val = env[item.env]
465
465
  } else {
466
466
  if (item.default) {
467
- item.val = item.default
467
+ if (typeof item.default === 'object') {
468
+ if (item.default.key) {
469
+ const hasProtocol = /^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(item.default.key);
470
+ const url = new URL(hasProtocol ? item.default.key : `https://${item.default.key}`);
471
+ item.host = url.host
472
+
473
+ let index = item.default.index || 0
474
+ item.index = index
475
+ item.val = await kernel.kv.get(item.host, index)
476
+ } else {
477
+ item.host = ""
478
+ }
479
+ } else {
480
+ item.val = item.default
481
+ }
468
482
  }
469
483
  requires_instantiation = true
470
484
  }
package/kernel/index.js CHANGED
@@ -118,21 +118,6 @@ class Kernel {
118
118
  }
119
119
  }
120
120
  }
121
- // path_exists(...args) {
122
- // return this.info.exists(...args)
123
- // }
124
- // path_resolve(...args) {
125
- // return this.info.path(...args)
126
- // }
127
- // script_running(...args) {
128
- // return this.info.running(...args)
129
- // }
130
- // script_local(...args) {
131
- // return this.info.local(...args)
132
- // }
133
- // script_global(...args) {
134
- // return this.info.global(...args)
135
- // }
136
121
  async env(...args) {
137
122
  let folderpath
138
123
  if (args) {
@@ -267,69 +252,40 @@ class Kernel {
267
252
  active = true
268
253
  }
269
254
  // console.log("kernel.refresh", { active, notify_peers })
270
- if (active) {
255
+
256
+ let installed = await this.bin.check_installed({ name: "caddy" })
257
+ console.log("caddy installed?", installed)
258
+ if (installed && active) {
271
259
 
272
260
  // 1. get the process list
273
- // console.log("Step 1: Get process list")
274
- console.log("> 1")
275
261
  await this.processes.refresh()
276
- // console.log("Process info", this.processes.info)
277
-
278
- console.log("> 2")
279
262
 
280
263
  // 2. refresh peer info to reflect the proc info
281
264
  await this.peer.refresh()
282
265
 
283
-
284
- console.log("> 3")
285
266
  // 3. load custom routers from ~/pinokio/network
286
267
  await this.router.init()
287
268
 
288
- console.log("> 4")
289
- // 3. set current local host router info
290
- // console.log("Step 3: Set current local host router")
269
+ // 4. set current local host router info
291
270
  await this.router.local()
292
- // console.log("router mapping after step 3", this.router.info)
293
271
 
294
- console.log("> 5")
295
- // 4. refresh peer info to reflect the updated router info
272
+ // 5. refresh peer info to reflect the updated router info
296
273
  await this.peer.refresh()
297
274
 
298
- console.log("> 6")
299
- // 4. tell peers to refresh
275
+ // 6. tell peers to refresh
300
276
  if (notify_peers) {
301
- // console.log("Step 4: notify peers to refresh")
302
- console.log("> 7")
303
277
  await this.peer.notify_peers()
304
278
  }
305
279
 
306
- console.log("> 8")
307
- // 4. update remote router
308
- // console.log("Step 5: Set remote routers")
280
+ // 7. update remote router
309
281
  await this.router.remote()
310
- // console.log("router mapping after step 5", this.router.info)
311
282
 
312
- console.log("> 9")
283
+ // 8. update caddy config
313
284
  await this.router.update()
314
285
 
286
+ // 9. announce self to the peer network
287
+ this.peer.announce()
315
288
 
316
- // await Promise.all([
317
- // // refresh proc info
318
- // this.processes.refresh(),
319
- // // refresh peer info
320
- // this.peer.refresh()
321
- // ])
322
- // console.log("proc info", this.processes.info)
323
- // console.log("peer info", this.peer.info)
324
- // // refresh router info
325
- // await this.router.refresh()
326
- // console.log("router info", this.router.published())
327
- //// await this.peer.refresh()
328
- //
329
- // if (notify_peers) {
330
- // // broadcast to peers to refresh
331
- // await this.peer.notify_peers()
332
- // }
333
289
  }
334
290
  }
335
291
  async clearLog(group) {
@@ -542,25 +498,13 @@ class Kernel {
542
498
  let home = this.store.get("home")
543
499
 
544
500
  // reset shells if they exist
545
- console.log("KERNEL INIT")
546
501
  if (this.shell) {
547
- console.log("> shell reset")
548
502
  this.shell.reset()
549
503
  }
550
504
  if (this.peer) {
551
- console.log("> peer stop")
552
505
  this.peer.stop()
553
506
  }
554
507
 
555
- // // kill all processes just in case
556
- // await new Promise((resolve, reject) => {
557
- // console.log("killing child processes for", process.pid)
558
- // kill(process.pid, {}, 'SIGKILL', () => {
559
- // console.log("child procs killed for", process.pid)
560
- // resolve()
561
- // });
562
- // })
563
-
564
508
  this.info = new Info(this)
565
509
  this.pipe = new Pipe(this)
566
510
  this.proto = new Proto(this)
package/kernel/info.js CHANGED
@@ -40,16 +40,13 @@ class Info {
40
40
  running(...args) {
41
41
  let cwd = path.dirname(this.caller())
42
42
  let resolved_path = path.resolve(cwd, ...args)
43
- console.log("api.running", this.kernel.api.running)
44
43
  let running = this.kernel.api.running[resolved_path]
45
- console.log("info.running", { cwd, resolved_path, running })
46
44
  return running ? running : false
47
45
  }
48
46
  exists(...args) {
49
47
  let cwd = path.dirname(this.caller())
50
48
  let resolved_path = path.resolve(cwd, ...args)
51
49
  let exists = fs.existsSync(resolved_path)
52
- console.log("info.exists", { cwd, resolved_path, exists })
53
50
  return exists ? exists: false
54
51
  }
55
52
  local(...args) {
package/kernel/kv.js CHANGED
@@ -12,6 +12,9 @@ class KV {
12
12
  json[host] = []
13
13
  }
14
14
  // if index doesn't exist, set index 0
15
+ if (!index) {
16
+ index = 0
17
+ }
15
18
  json[host][index] = val
16
19
  await fs.promises.writeFile(filePath, JSON.stringify(json, null, 2), 'utf8')
17
20
  }
package/kernel/loader.js CHANGED
@@ -6,14 +6,6 @@ const clearModule = require('clear-module');
6
6
 
7
7
  class Loader {
8
8
  async load(_path) {
9
-
10
- // let exists = await new Promise(r=>fs.access(_path, fs.constants.F_OK, e => r(!e)))
11
- // if (!exists) {
12
- // console.log(`[load] ${_path} does not exist`)
13
- // return { resolved: null }
14
- // }
15
-
16
-
17
9
  let resolved
18
10
  let dirname
19
11
  let extension = path.extname(_path)
@@ -51,21 +43,18 @@ class Loader {
51
43
  async requireJSON(filepath) {
52
44
  let config
53
45
  try { config = require(filepath) } catch (e) {
54
- // console.log(`[did not load] ${filepath}`)
55
46
  }
56
47
  return config
57
48
  }
58
49
  async requireJS(filepath) {
59
50
  let config
60
51
  try { config = require(filepath) } catch (e) {
61
- // console.log(`[did not load] ${filepath}`)
62
52
  }
63
53
  try {
64
54
  // if the required module is a class, return the instantiated object
65
55
  return new config();
66
56
  } catch (e) {
67
57
  // otherwise return normally
68
- // console.log(`[did not load] ${filepath}`)
69
58
  return config
70
59
  }
71
60
  }
package/kernel/peer.js CHANGED
@@ -10,6 +10,7 @@ class PeerDiscovery {
10
10
  this.peers = new Set();
11
11
  this.host = this._getLocalIPAddress()
12
12
  this.default_port = 42000
13
+ this.peers.add(this.host)
13
14
  // this.start();
14
15
  }
15
16
  stop() {
@@ -19,6 +20,9 @@ class PeerDiscovery {
19
20
  this.socket.close()
20
21
  }
21
22
  }
23
+ announce() {
24
+ this.socket.send(this.message, 0, this.message.length, this.port, '192.168.1.255');
25
+ }
22
26
  async start(kernel) {
23
27
  let env = await Environment.get(kernel.homedir)
24
28
 
@@ -36,12 +40,9 @@ class PeerDiscovery {
36
40
 
37
41
  if (this.active) {
38
42
  // Listen for incoming pings
39
- console.log("kernel.peer start")
40
43
  this.socket = dgram.createSocket('udp4');
41
44
  this.socket.on('message', (msg, rinfo) => {
42
- // console.log("peer message", { msg, rinfo })
43
45
  const ip = rinfo.address;
44
- // console.log({rinfo})
45
46
  if (msg.toString() === this.message.toString() && this._isLocalLAN(ip)) {
46
47
  if (!this.peers.has(ip)) {
47
48
  console.log(`Discovered peer: ${ip}`);
@@ -62,16 +63,13 @@ class PeerDiscovery {
62
63
 
63
64
  this.socket.setBroadcast(true);
64
65
 
65
- // Send broadcast pings every interval
66
- this.interval_handle = setInterval(() => {
67
- // console.log("send message to peers")
68
- //this.socket.send(this.message, 0, this.message.length, this.port, '127.0.0.1');
69
- //console.log("sent to 127.0.0.1")
70
- //this.socket.send(this.message, 0, this.message.length, this.port, '255.255.255.255');
71
- this.socket.send(this.message, 0, this.message.length, this.port, '192.168.1.255');
72
- //console.log("sent to 255.255.255.255")
73
- // console.log("sent message")
74
- }, this.interval);
66
+ this.announce()
67
+
68
+ // // Send broadcast pings every interval
69
+ // this.interval_handle = setInterval(() => {
70
+ // //this.socket.send(this.message, 0, this.message.length, this.port, '255.255.255.255');
71
+ // this.socket.send(this.message, 0, this.message.length, this.port, '192.168.1.255');
72
+ // }, this.interval);
75
73
  });
76
74
  }
77
75
  }
@@ -86,7 +84,6 @@ class PeerDiscovery {
86
84
  }
87
85
  }
88
86
  async _broadcast(host) {
89
- // console.log("peer _broadcast", host)
90
87
  try {
91
88
  let res = await axios.post(`http://${host}:${this.default_port}/pinokio/peer/refresh`, {
92
89
  timeout: 2000
@@ -119,7 +116,6 @@ class PeerDiscovery {
119
116
  let peer_info = await Promise.all(refresh_peers.map((host) => {
120
117
  return this._refresh(host)
121
118
  }))
122
- // console.log({ peer_info })
123
119
  for(let i=0; i<peer_info.length; i++) {
124
120
  let peer = peer_info[i]
125
121
  if (peer) {
@@ -129,7 +125,6 @@ class PeerDiscovery {
129
125
  }
130
126
  }
131
127
  }
132
- // console.log("REFRESH", this.info)
133
128
  this.refreshing = false
134
129
  return this.info
135
130
  }
package/kernel/procs.js CHANGED
@@ -105,10 +105,6 @@ class Procs {
105
105
  return { port, pid , name, fullname, ip }
106
106
  }
107
107
  }).filter((x) => { return x })
108
- // list = list.filter((item) => {
109
- // return !["caddy", "caddy.exe"].includes(item.name.toLowerCase())
110
- // })
111
- // console.log("#LIST", { list, size: list.length })
112
108
  resolve(list)
113
109
  });
114
110
  });
@@ -11,7 +11,6 @@ class Common extends Processor {
11
11
  "headers": {
12
12
  "request": {
13
13
  "set": {
14
- // "Origin": ["http://127.0.0.1:11434"],
15
14
  "X-Forwarded-Proto": ["https"],
16
15
  "X-Forwarded-Host": ["{http.request.host}"]
17
16
  }
@@ -25,25 +24,7 @@ class Common extends Processor {
25
24
  }
26
25
  }
27
26
  }
28
- },
29
- //{
30
- // "handler": "headers",
31
- // "request": {
32
- // "set": {
33
- // "X-Forwarded-Proto": ["https"],
34
- // "X-Forwarded-Host": ["{http.request.host}"]
35
- // }
36
- // },
37
- // "response": {
38
- // "set": {
39
- // "Access-Control-Allow-Origin": ["*"],
40
- // "Access-Control-Allow-Methods": ["GET, POST, OPTIONS, PUT, DELETE"],
41
- // "Access-Control-Allow-Headers": ["*"],
42
- // "Vary": ["Origin"]
43
- // }
44
- // }
45
- //}
46
- ]
27
+ }]
47
28
 
48
29
  // if the dial port has been overridden by router.custom_routers, use that instead
49
30
  let parsed_dial = this.parse_ip(dial)
@@ -5,12 +5,10 @@ class Connector extends Processor {
5
5
  this.router = router
6
6
  }
7
7
  handle ({ match, connector, dial, }) {
8
- // console.log("connector.handle", { match, connector, dial })
9
8
  let connector_name = connector.host + ":" + connector.port
10
9
  let listener = "0.0.0.0:PORT_PLACEHOLDER_" + connector_name
11
10
  let listener_pointer = connector.host + ":PORT_PLACEHOLDER_" + connector_name
12
11
  let port_placeholder = "PORT_PLACEHOLDER_" + connector_name
13
- // console.log("CONNECTING", { listener, dial, listener_pointer, match })
14
12
 
15
13
  let handler = [{
16
14
  "handler": "reverse_proxy",
@@ -18,7 +16,6 @@ class Connector extends Processor {
18
16
  "headers": {
19
17
  "request": {
20
18
  "set": {
21
- // "Origin": ["http://127.0.0.1:11434"],
22
19
  "X-Forwarded-Proto": ["{http.request.header.X-Forwarded-Proto}"],
23
20
  //"X-Forwarded-Proto": ["{http.request.scheme}"],
24
21
  //"X-Forwarded-Proto": ["https"],
@@ -34,23 +31,6 @@ class Connector extends Processor {
34
31
  }
35
32
  }
36
33
  }
37
- // {
38
- // "handler": "headers",
39
- // "request": {
40
- // "set": {
41
- // "X-Forwarded-Proto": ["https"],
42
- // "X-Forwarded-Host": ["{http.request.host}"]
43
- // }
44
- // },
45
- // "response": {
46
- // "set": {
47
- // "Access-Control-Allow-Origin": ["*"],
48
- // "Access-Control-Allow-Methods": ["GET, POST, OPTIONS, PUT, DELETE"],
49
- // "Access-Control-Allow-Headers": ["*"],
50
- // "Vary": ["Origin"]
51
- // }
52
- // }
53
- // }
54
34
  }]
55
35
  // if the dial port has been overridden by router.custom_routers, use that instead
56
36
  let parsed_dial = this.parse_ip(dial)
@@ -93,28 +73,9 @@ class Connector extends Processor {
93
73
  }
94
74
  }
95
75
  },
96
- // {
97
- // "handler": "headers",
98
- // "request": {
99
- // "set": {
100
- // "X-Forwarded-Proto": ["https"],
101
- // "X-Forwarded-Host": ["{http.request.host}"]
102
- // }
103
- // },
104
- // "response": {
105
- // "set": {
106
- // "Access-Control-Allow-Origin": ["*"],
107
- // "Access-Control-Allow-Methods": ["GET, POST, OPTIONS, PUT, DELETE"],
108
- // "Access-Control-Allow-Headers": ["*"],
109
- // "Vary": ["Origin"]
110
- // }
111
- // }
112
- // }
113
76
  ]
114
77
  })
115
78
  this.router.add({ host: connector.host, dial: listener_pointer, match })
116
- // this.router._tree[connector_name] = dial
117
- // this.router._tree[connector_name] = dial
118
79
  }
119
80
  }
120
81
  module.exports = Connector