Skip to content

Feature Request: Allow configuring daemon port in extension UI | 浏览器扩展支持配置 daemon 端口 #114

Description

@MUYUTwilighter

Summary

Please add a configuration interface to the BrowserSkill extension that allows users to change the local daemon WebSocket port.

The bsk CLI already supports selecting another port with:

bsk daemon start --port <PORT>

However, the store-installed browser extension still connects to the default port 52800. This makes the CLI's --port option ineffective for normal extension users.

Environment

  • OS: Windows 10 22H2, build 19045.6456
  • WSL: 2.7.11.0, NAT networking
  • bsk CLI: 0.1.10
  • BrowserSkill extension: 0.1.6
  • Browsers: Chrome and Microsoft Edge

Problem

On my Windows machine, port 52800 belongs to an excluded TCP port range:

Start Port    End Port
52738         52837

As a result, starting the daemon with the default configuration fails:

> bsk daemon start
error: daemon failed to start within 3s (no valid daemon.json)

Starting it on another port works correctly:

bsk daemon start --port 53200
daemon version      0.1.10
WS port             53200
browsers connected  0

The daemon is healthy, but the Chrome and Edge extensions remain disconnected because they still attempt to connect to port 52800.

This situation can occur on Windows when WSL2, HNS, Hyper-V, Docker, or other networking components reserve dynamic port ranges.

Expected Behavior

The extension should provide a small configuration interface in its popup or options page.

Suggested settings:

  • Daemon port, defaulting to 52800
  • Validation for values between 1 and 65535
  • Persist the setting with chrome.storage.local
  • Reconnect immediately after the setting is saved
  • Display the current target, for example ws://127.0.0.1:53200
  • Provide a “Reset to default” action

For security, configuring only the loopback port would be sufficient. Allowing arbitrary remote hosts is not required.

Why This Is Needed

The CLI already exposes a --port option, but users of the store extension currently cannot configure the matching endpoint. This creates an asymmetric configuration:

  • Daemon port: configurable
  • Store extension port: effectively fixed

A configurable extension port would avoid requiring users to:

  • Modify Windows excluded port ranges
  • Disable or reconfigure WSL/Hyper-V networking
  • Build a custom extension
  • Manually patch generated extension files

Related Implementation

The daemon binds its WebSocket port before publishing daemon.json:

https://github.com/Tencent/BrowserSkill/blob/main/crates/bsk-cli/src/daemon/start.rs

There was also prior work to make the extension WebSocket URL configurable at build time:

#13

It would be helpful to expose this configuration at runtime through the extension UI.

中文说明

Windows 上的 WSL2/HNS/Hyper-V 可能动态保留包含 52800 的端口段。虽然 bsk daemon start --port 53200 可以正常启动 daemon,但商店版浏览器扩展仍固定连接默认端口,导致扩展始终显示未连接。

希望扩展弹窗或设置页面能够配置 daemon 端口,并在保存后自动重连。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions