MoonshotAI / MoonshotAI/kimi-code
Feature: Support LAN access by binding to 0.0.0.0 instead of localhost
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:
- A config file option like
server.host = "0.0.0.0"in~/.kimi-code/config.toml - Environment variable
KIMI_HOST=0.0.0.0
Environment
- Version: 0.18.0
- OS: macOS/Linux
- Installation: npm/pip
动机(中文)
运行 kimi web 或 kimi server run 时,Web UI 仅绑定到 localhost(127.0.0.1),这阻止了从远程机器或通过 VPN/Tailscale 连接进行访问。
这是一个常见的需求,适用于:
- 通过 Tailscale/Headscale VPN 进行远程访问
- 从同一网络中的其他机器访问
- 需要远程访问服务的 CI/CD 场景
- WSL2 访问 Windows 主机上运行的服务
建议方案(中文)
为 kimi web 和 kimi 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
替代考虑(中文)
如果默认绑定到所有接口存在安全顾虑,也可以通过以下方式实现:
- 配置文件选项,如
~/.kimi-code/config.toml中的server.host = "0.0.0.0" - 环境变量
KIMI_HOST=0.0.0.0
环境(中文)
- 版本:0.18.0
- 操作系统:macOS/Linux
- 安装方式:npm/pip
Thank you for considering this feature request! / 感谢考虑此功能请求!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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