pinokiod 3.8.102 → 3.8.103
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.
|
@@ -4,7 +4,7 @@ class Connector {
|
|
|
4
4
|
}
|
|
5
5
|
handle ({ match, connector, dial, }) {
|
|
6
6
|
console.log("connector.handle", { match, connector, dial })
|
|
7
|
-
let connector_name = connector.host + "
|
|
7
|
+
let connector_name = connector.host + ":" + connector.port
|
|
8
8
|
let listener = "0.0.0.0:PORT_PLACEHOLDER_" + connector_name
|
|
9
9
|
let listener_pointer = connector.host + ":PORT_PLACEHOLDER_" + connector_name
|
|
10
10
|
if(!this.router.config.apps.http.servers[connector_name]) {
|
package/kernel/router/index.js
CHANGED
|
@@ -89,7 +89,7 @@ class Router {
|
|
|
89
89
|
async fill() {
|
|
90
90
|
const jsonString = JSON.stringify(this.config)
|
|
91
91
|
// find all PORT_PLACEHOLDER patterns
|
|
92
|
-
const matches = jsonString.match(/:PORT_PLACEHOLDER_[0-9
|
|
92
|
+
const matches = jsonString.match(/:PORT_PLACEHOLDER_[0-9.:]+/g)
|
|
93
93
|
|
|
94
94
|
|
|
95
95
|
// iterate through them and see if the port already exists
|
|
@@ -124,8 +124,9 @@ class Router {
|
|
|
124
124
|
// local_share_ip :- 192.168....
|
|
125
125
|
let local_share_key = key.replace("PORT_PLACEHOLDER_", "")
|
|
126
126
|
let chunks = local_share_key.split(":")
|
|
127
|
-
let
|
|
128
|
-
let
|
|
127
|
+
let original_port = chunks[chunks.length-1]
|
|
128
|
+
let local_share_ip = chunks.slice(0, chunks.length-1).join(":")
|
|
129
|
+
|
|
129
130
|
let local_share_port = replaced_map[key]
|
|
130
131
|
if (!this.local_network_mapping[local_share_ip]) {
|
|
131
132
|
this.local_network_mapping[local_share_ip] = {}
|
|
@@ -11,7 +11,8 @@ class PeerPeerRouter {
|
|
|
11
11
|
let exposed_matches = matches.filter((m) => {
|
|
12
12
|
return m.endsWith(`${peer.name}.localhost`)
|
|
13
13
|
})
|
|
14
|
-
let
|
|
14
|
+
let chunks = dial.split(":")
|
|
15
|
+
let port = chunks[chunks.length-1]
|
|
15
16
|
let exposed_dial = `${peer.host}:${port}` // exposed_dial :- 192.168...
|
|
16
17
|
for(let match of exposed_matches) {
|
|
17
18
|
console.log("common.handle", { match, exposed_dial, host: peer.host })
|