MoonshotAI / MoonshotAI/kimi-code

Feature: Support LAN access by binding to 0.0.0.0 instead of localhost

Open
#908 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
7.5k
Forks
1.2k
Avg merge
11h 53m
Merged PRs (30d)
350

Description

Motivation

When running kimi web or kimi server run, the web UI only binds to localhost (127.0.0.1), which prevents access from remote machines or over VPN/Tailscale connections.

This is a common requirement for:

  • Remote access via Tailscale/Headscale VPN
  • Accessing from other machines on the same network
  • CI/CD scenarios where the service needs to be accessed remotely
  • WSL2 accessing a Windows-hosted service

Proposed Solution

Add a --host option to kimi web and kimi server run commands to allow binding to a specific IP or 0.0.0.0 for LAN access.

Example:

kimi web --port 5494 --host 0.0.0.0
# or
kimi server run --port 5494 --host 0.0.0.0

Alternative Considerations

If there are security concerns about binding to all interfaces by default, this could also be achieved through:

  1. A config file option like server.host = "0.0.0.0" in ~/.kimi-code/config.toml
  2. Environment variable KIMI_HOST=0.0.0.0

Environment

  • Version: 0.18.0
  • OS: macOS/Linux
  • Installation: npm/pip

动机(中文)

运行 kimi webkimi server run 时,Web UI 仅绑定到 localhost(127.0.0.1),这阻止了从远程机器或通过 VPN/Tailscale 连接进行访问。

这是一个常见的需求,适用于:

  • 通过 Tailscale/Headscale VPN 进行远程访问
  • 从同一网络中的其他机器访问
  • 需要远程访问服务的 CI/CD 场景
  • WSL2 访问 Windows 主机上运行的服务

建议方案(中文)

kimi webkimi server run 命令添加 --host 选项,以允许绑定到特定 IP 或 0.0.0.0 以实现局域网访问。

示例:

kimi web --port 5494 --host 0.0.0.0
# 或
kimi server run --port 5494 --host 0.0.0.0

替代考虑(中文)

如果默认绑定到所有接口存在安全顾虑,也可以通过以下方式实现:

  1. 配置文件选项,如 ~/.kimi-code/config.toml 中的 server.host = "0.0.0.0"
  2. 环境变量 KIMI_HOST=0.0.0.0

环境(中文)

  • 版本:0.18.0
  • 操作系统:macOS/Linux
  • 安装方式:npm/pip

Thank you for considering this feature request! / 感谢考虑此功能请求!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the CLI entry points for kimi web and kimi server run, then trace where each command binds to localhost. Add a host option that accepts a specific address or 0.0.0.0 for both commands, and verify that the selected address is used when the services start.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli, networking
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.