vite-plugin-opencode-assistant 1.0.77 → 1.0.79

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.
@@ -7,6 +7,8 @@ export interface ProxyServerOptions {
7
7
  language?: OpenCodeLanguage;
8
8
  /** OpenCode 内部设置 */
9
9
  settings?: OpenCodeSettings;
10
+ /** 绑定地址,需与端口检查使用的地址族一致,避免 IPv4/IPv6 不匹配 */
11
+ hostname?: string;
10
12
  }
11
13
  export interface ProxyServerResult {
12
14
  server: http.Server;
@@ -480,7 +480,7 @@ function startProxyServer(targetUrl, port, options = {}) {
480
480
  });
481
481
  server.timeout = 0;
482
482
  server.keepAliveTimeout = 0;
483
- server.listen(port, () => {
483
+ server.listen(port, options.hostname || void 0, () => {
484
484
  const address = server.address();
485
485
  const actualPort = typeof address === "object" && address ? address.port : port;
486
486
  log.debug(`Proxy server started on port ${actualPort} -> ${targetUrl}`);
@@ -202,7 +202,8 @@ Please install OpenCode first:
202
202
  const result = yield startProxyServer(webUrl, this.actualProxyPort, {
203
203
  theme: this.config.theme,
204
204
  language: this.config.language,
205
- settings: this.config.settings
205
+ settings: this.config.settings,
206
+ hostname: this.config.hostname
206
207
  });
207
208
  this.proxyServer = result.server;
208
209
  if (result.actualPort !== this.actualProxyPort) {
@@ -220,7 +221,8 @@ Please install OpenCode first:
220
221
  const result = yield startProxyServer(webUrl, nextPort, {
221
222
  theme: this.config.theme,
222
223
  language: this.config.language,
223
- settings: this.config.settings
224
+ settings: this.config.settings,
225
+ hostname: this.config.hostname
224
226
  });
225
227
  this.proxyServer = result.server;
226
228
  this.actualProxyPort = result.actualPort;