openclaw-navigator 4.6.0 → 4.7.0

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.
Files changed (2) hide show
  1. package/cli.mjs +11 -28
  2. package/package.json +1 -1
package/cli.mjs CHANGED
@@ -864,10 +864,9 @@ function handleRequest(req, res) {
864
864
  }
865
865
 
866
866
  // ── Reverse proxy: /ui/* → OC Web UI (localhost:ocUIPort) ──────────────
867
- // Strips /ui prefix so /ui/dashboard localhost:4000/dashboard
867
+ // Keep /ui prefix Next.js basePath: "/ui" expects it
868
868
  if (path === "/ui" || path.startsWith("/ui/")) {
869
- const targetPath = path === "/ui" ? "/" : path.slice(3); // strip "/ui"
870
- const targetURL = `${targetPath}${url.search}`;
869
+ const targetURL = `${path}${url.search}`;
871
870
 
872
871
  const proxyOpts = {
873
872
  hostname: "127.0.0.1",
@@ -942,32 +941,16 @@ function handleRequest(req, res) {
942
941
  return;
943
942
  }
944
943
 
945
- // ── Root → proxy to OC Web UI if available, else show bridge status ──
944
+ // ── Root → redirect to /ui/ (Next.js basePath) or show bridge status ──
946
945
  if (req.method === "GET" && path === "") {
947
946
  // Quick probe to check if OC UI is running
948
947
  const probe = httpRequest(
949
- { hostname: "127.0.0.1", port: ocUIPort, path: "/", method: "HEAD", timeout: 1000 },
948
+ { hostname: "127.0.0.1", port: ocUIPort, path: "/ui/", method: "HEAD", timeout: 1000 },
950
949
  (probeRes) => {
951
950
  probeRes.resume(); // drain
952
- // OC UI is running — proxy root to it
953
- const rootProxyOpts = {
954
- hostname: "127.0.0.1",
955
- port: ocUIPort,
956
- path: `/${url.search}`,
957
- method: req.method,
958
- headers: { ...req.headers, host: `127.0.0.1:${ocUIPort}` },
959
- };
960
- const rootProxy = httpRequest(rootProxyOpts, (rootRes) => {
961
- const headers = { ...rootRes.headers };
962
- headers["access-control-allow-origin"] = "*";
963
- res.writeHead(rootRes.statusCode ?? 502, headers);
964
- rootRes.pipe(res, { end: true });
965
- });
966
- rootProxy.on("error", () => {
967
- res.writeHead(302, { Location: "/ui/" });
968
- res.end();
969
- });
970
- rootProxy.end();
951
+ // OC UI is running — redirect to /ui/
952
+ res.writeHead(302, { Location: "/ui/" });
953
+ res.end();
971
954
  },
972
955
  );
973
956
  probe.on("error", () => {
@@ -975,8 +958,8 @@ function handleRequest(req, res) {
975
958
  sendJSON(res, 200, {
976
959
  ok: true,
977
960
  service: "openclaw-navigator-bridge",
978
- version: "4.4.0",
979
- ui: { available: false, port: ocUIPort, hint: "Start the OC gateway to enable /ui/" },
961
+ version: "4.6.0",
962
+ ui: { available: false, port: ocUIPort, hint: "Start the OC Web UI to enable /ui/" },
980
963
  gateway: { port: ocGatewayPort },
981
964
  navigator: { connected: bridgeState.connected },
982
965
  });
@@ -986,7 +969,7 @@ function handleRequest(req, res) {
986
969
  sendJSON(res, 200, {
987
970
  ok: true,
988
971
  service: "openclaw-navigator-bridge",
989
- version: "4.4.0",
972
+ version: "4.6.0",
990
973
  ui: { available: false, port: ocUIPort, hint: "OC UI timed out" },
991
974
  });
992
975
  });
@@ -1537,7 +1520,7 @@ module.exports = {
1537
1520
  };
1538
1521
 
1539
1522
  await Promise.all([
1540
- checkPort("OC Web UI", ocUIPort, "/"),
1523
+ checkPort("OC Web UI", ocUIPort, "/ui/"),
1541
1524
  checkPort("OC Gateway", ocGatewayPort, "/health"),
1542
1525
  ]);
1543
1526
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openclaw-navigator",
3
- "version": "4.6.0",
3
+ "version": "4.7.0",
4
4
  "description": "One-command bridge + tunnel for the Navigator browser — works on any machine, any OS",
5
5
  "keywords": [
6
6
  "browser",