@cloud-cli/px 4.2.3 → 4.2.5
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.
- package/dist/proxy-manager.js +6 -3
- package/package.json +1 -1
package/dist/proxy-manager.js
CHANGED
|
@@ -146,19 +146,22 @@ export class ProxyManager {
|
|
|
146
146
|
const json = JSON.parse(state.stdout);
|
|
147
147
|
return json
|
|
148
148
|
.map(readDockerContainer)
|
|
149
|
-
.filter(d => d.ports.length &&
|
|
149
|
+
.filter(d => d.ports.length && d.labels.host);
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
152
|
function readProxyFromContainer(c) {
|
|
153
|
+
const domain = [c.labels.host, c.labels.path].join("/");
|
|
154
|
+
const proxyOverrides = get(domain) || {};
|
|
153
155
|
return {
|
|
154
|
-
domain: [c.labels.host, c.labels.path].join("/"),
|
|
155
|
-
target: `http://localhost:${c.ports[0].host}`,
|
|
156
156
|
redirect: true,
|
|
157
157
|
redirectUrl: "",
|
|
158
158
|
cors: true,
|
|
159
159
|
authorization: "",
|
|
160
160
|
preserveHost: false,
|
|
161
161
|
headers: "",
|
|
162
|
+
...proxyOverrides,
|
|
163
|
+
domain,
|
|
164
|
+
target: `http://localhost:${c.ports[0].host}`,
|
|
162
165
|
};
|
|
163
166
|
}
|
|
164
167
|
function readDockerContainer(d) {
|