mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
fix: sandbox browser CDP proxy
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
- Sandbox browser: proxy CDP out of the container so host port mappings work (fixes `attachOnly` “profile not running”). — thanks @steipete
|
||||||
- Agents: gate heartbeat prompt to default agent sessions (including non-agent session keys). (#630) — thanks @adam91holt
|
- Agents: gate heartbeat prompt to default agent sessions (including non-agent session keys). (#630) — thanks @adam91holt
|
||||||
- Agent: fast abort on /stop and cancel tool calls between tool boundaries. (#617)
|
- Agent: fast abort on /stop and cancel tool calls between tool boundaries. (#617)
|
||||||
- Models/Auth: add OpenCode Zen (multi-model proxy) onboarding. (#623) — thanks @magimetal
|
- Models/Auth: add OpenCode Zen (multi-model proxy) onboarding. (#623) — thanks @magimetal
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ RUN apt-get update \
|
|||||||
jq \
|
jq \
|
||||||
novnc \
|
novnc \
|
||||||
python3 \
|
python3 \
|
||||||
|
socat \
|
||||||
websockify \
|
websockify \
|
||||||
x11vnc \
|
x11vnc \
|
||||||
xvfb \
|
xvfb \
|
||||||
|
|||||||
@@ -25,9 +25,15 @@ else
|
|||||||
CHROME_ARGS=()
|
CHROME_ARGS=()
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "${CDP_PORT}" -ge 65535 ]]; then
|
||||||
|
CHROME_CDP_PORT="$((CDP_PORT - 1))"
|
||||||
|
else
|
||||||
|
CHROME_CDP_PORT="$((CDP_PORT + 1))"
|
||||||
|
fi
|
||||||
|
|
||||||
CHROME_ARGS+=(
|
CHROME_ARGS+=(
|
||||||
"--remote-debugging-address=0.0.0.0"
|
"--remote-debugging-address=127.0.0.1"
|
||||||
"--remote-debugging-port=${CDP_PORT}"
|
"--remote-debugging-port=${CHROME_CDP_PORT}"
|
||||||
"--user-data-dir=${HOME}/.chrome"
|
"--user-data-dir=${HOME}/.chrome"
|
||||||
"--no-first-run"
|
"--no-first-run"
|
||||||
"--no-default-browser-check"
|
"--no-default-browser-check"
|
||||||
@@ -42,6 +48,17 @@ CHROME_ARGS+=(
|
|||||||
|
|
||||||
chromium "${CHROME_ARGS[@]}" about:blank &
|
chromium "${CHROME_ARGS[@]}" about:blank &
|
||||||
|
|
||||||
|
for _ in $(seq 1 50); do
|
||||||
|
if curl -sS --max-time 1 "http://127.0.0.1:${CHROME_CDP_PORT}/json/version" >/dev/null; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
sleep 0.1
|
||||||
|
done
|
||||||
|
|
||||||
|
socat \
|
||||||
|
TCP-LISTEN:"${CDP_PORT}",fork,reuseaddr,bind=0.0.0.0 \
|
||||||
|
TCP:127.0.0.1:"${CHROME_CDP_PORT}" &
|
||||||
|
|
||||||
if [[ "${ENABLE_NOVNC}" == "1" && "${HEADLESS}" != "1" ]]; then
|
if [[ "${ENABLE_NOVNC}" == "1" && "${HEADLESS}" != "1" ]]; then
|
||||||
x11vnc -display :1 -rfbport "${VNC_PORT}" -shared -forever -nopw -localhost &
|
x11vnc -display :1 -rfbport "${VNC_PORT}" -shared -forever -nopw -localhost &
|
||||||
websockify --web /usr/share/novnc/ "${NOVNC_PORT}" "localhost:${VNC_PORT}" &
|
websockify --web /usr/share/novnc/ "${NOVNC_PORT}" "localhost:${VNC_PORT}" &
|
||||||
|
|||||||
Reference in New Issue
Block a user