Repository navigation
允许内网 http 地址连接自建模型服务 - #8
Closed
Wendell-Guan wants to merge 1 commit into
Closed
Wendell-Guan wants to merge 1 commit into
Wendell-Guan wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
|
作者你好,内网 http 的支持我已经在这个 PR 里加好了。你看一下没问题的话,合并之后帮忙打个新包就行,谢谢! |
Owner
|
感谢提交和说明自建服务的使用场景!从 0.1.10 开始,Droidance 已支持连接局域网 HTTP 模型服务,并在实际请求及重定向时检查目标地址。 主线采用了不同的实现,所以这里先关闭这个 PR。欢迎使用 0.2.0 测试你的服务;如果仍有连接问题,请提供不含密钥的配置和错误信息,我们再继续排查。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
作者你好,我在公司内网自己部署了一个 OpenAI 兼容的模型服务,地址是
http://192.168.1.40:8000/v1。在 Droidance 里填上之后一直提示连接失败,但同一台手机用浏览器访问这个地址是正常的。查了一下,原因是
network_security_config.xml只允许localhost走 http,局域网里的 http 地址在系统层面就被拦掉了。像 Ollama、vLLM、llama.cpp、LM Studio 这类自建服务,一般都是内网 http,不太好配 https 证书,所以我改了一下:network_security_config.xml:放开明文 http。network_security_config 没法按 IP 段写规则,所以只能在系统层面整体放开。ProviderEditViewModel.kt:限制 http 的使用范围,只有地址是本机或内网时才允许填 http。内网指localhost、127.x、10.x、172.16–31.x、192.168.x、169.254.x、100.64–127.x(Tailscale 之类的组网工具会用这个段)、.local/.lan结尾的域名,以及 IPv6 的::1、fc00::/7、fe80::。公网地址还是必须用 https,所以对普通用户来说安全性没有变化。我这边还没有安卓打包环境,没有编译和实测过,麻烦你看一下。如果你觉得改成在设置里加一个开关更合适,我也可以按那个方式改。谢谢!
🤖 Generated with Claude Code