{"id":15108710,"url":"https://github.com/overcache/vrouter","last_synced_at":"2025-09-27T08:30:45.537Z","repository":{"id":46704176,"uuid":"90977084","full_name":"overcache/VRouter","owner":"overcache","description":"一个基于 VirtualBox 和 openwrt 构建的项目, 旨在实现 macOS / Windows 平台的透明代理.","archived":true,"fork":false,"pushed_at":"2019-11-20T16:59:27.000Z","size":18397,"stargazers_count":1293,"open_issues_count":31,"forks_count":162,"subscribers_count":49,"default_branch":"dev","last_synced_at":"2024-07-10T14:31:46.784Z","etag":null,"topics":["openwrt","transparent-proxy","virtualbox"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/overcache.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-11T12:32:51.000Z","updated_at":"2024-07-09T20:08:07.000Z","dependencies_parsed_at":"2022-09-04T05:00:20.814Z","dependency_job_id":null,"html_url":"https://github.com/overcache/VRouter","commit_stats":null,"previous_names":["icymind/vrouter"],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/overcache%2FVRouter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/overcache%2FVRouter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/overcache%2FVRouter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/overcache%2FVRouter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/overcache","download_url":"https://codeload.github.com/overcache/VRouter/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234410582,"owners_count":18828242,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["openwrt","transparent-proxy","virtualbox"],"created_at":"2024-09-25T22:22:40.256Z","updated_at":"2025-09-27T08:30:44.201Z","avatar_url":"https://github.com/overcache.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## update\n\n已停止开发. \n\n\n推荐关注其他透明代理的开源项目, 如 [mellow](https://github.com/mellow-io/mellow)\n\n---\n\n![img](./doc/features01.jpg)\n\n[![JavaScript Style Guide](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n### VRouter\n\n一个基于 Virtualbox 和 openwrt 构建的项目, 旨在实现 macOS / Windows 平台上的透明代理.\n\nVRouter 在后台运行一个 openwrt 的虚拟机, 通过更改系统的默认路由, 将所有系统数据包转发到虚拟机上. 依托 openwrt 的 iptables 进行数据包的处理.\n\n了解[构造过程](https://icymind.com/virtual-openwrt/)\n\n### 如何使用\n\n前提条件:\n\n1. 为了能在服务端进行 DNS 查询, 请确保 ss-server 开启了 UDP 转发.\n2. 为了能确保虚拟机可以联网, 确保上游路由器开启了 DHCP.\n3. [为了避免频繁在弹窗里输入密码，请设置免密码切换网关](https://github.com/icymind/VRouter/wiki/%E9%81%BF%E5%85%8D%E6%AF%8F%E6%AC%A1%E5%88%87%E6%8D%A2%E7%BD%91%E5%85%B3%E9%83%BD%E8%BE%93%E5%85%A5%E5%AF%86%E7%A0%81)\n\n### 自定义黑白名单\n\n- 每个域名/IP/IP段一行, 注释行以#开头\n- 域名\n\t- 域名可以是裸域名如 `example.com`, 将会匹配该域下的所有子域名如  `a.example.com`, `b.example.com` 等等\n\t- 也可以填写子域名如 `a.example.com`, 如此不会匹配到 `b.example.com`\n- IP\n\t- 可以是独立的IP, 如 `123.123.123.123`\n\t- 也可以是IP段, 如 `123.123.123.0/8` 将会匹配 `123.123.123.0~123.123.123.255` 之间的IP地址. `123.123.0.0/16`将匹配 `123.123.0.0 ~ 123.123.255.255`之间的IP地址\n\n### 项目的意义\n\n#### 为什么需要透明代理?\n\n使用 Shadowsocks 桌面客户端可以很方便地进行非透明代理, 但是仍然有以下的不足\n\n- 每个需要代理的软件都要逐一设置\n- 命令行软件虽然可以用 `export http_proxy` 的方式使用代理, 但有时并不管用. 需要进一步折腾 Proxifier 或者 Privoxy\n- 有些软件并不支持设置代理, 如 macOS 系统自带的 Mail APP\n- 鲜有支持 UDP 的软件\n\n#### 为什么不在路由器上设置透明代理?\n\n强烈推荐在路由器设置透明代理. 但是, 在路由器透明代理虽然解决了客户端的不足, 仍然有其局限性.\n\n- 如果路由器性能不足, 使用 kcptun 等软件时, 负载会非常高. 而且速度比在桌面端运行 kcptun 慢很多\n- 路由器只能在固定地点使用\n\n#### 为什么不用 TUN/TAP 虚拟网络接口?\n\nTUN/TAP 是一个很优雅的方案, 不需要依赖 VirtualBox. Windows 上有很好的 TAP 透明代理方案 [SSTap](https://www.sockscap64.com/en/sstap-enjoy-gaming-enjoy-sstap), Linux 上也有诸如 [kone](https://github.com/xjdrew/kone) 这样的项目. 遗憾的是 kone 的上游项目 [water](https://github.com/songgao/water) 目前对 macOS 的[支持有限](https://github.com/songgao/water#supported-platforms). 因此:\n- 在目前来看, 在 macOS 上用轻量的 OpenWRT 实现透明代理, 仍然是一个实用的方案.\n- 相对新的项目, OpenWRT 和 VirtualBox 的组合更稳定.\n- 在 OpenWRT 上可以根据情况随时更换代理软件, 适应性更强.\n\n#### 用虚拟机会不会有点杀鸡用牛刀?\n\n大材小用确实有点委屈了虚拟机. 幸运的是 openwrt 非常轻量, 官网提供的镜像不足 5 MB, 转化为 virtualbox 虚拟机磁盘文件, 并在虚拟机上安装必要的软件后, 磁盘空间占用不足 30 MB. 虚拟机在 macOS 上的内存占用在 150MB 以内, 在 Windows 上的内存占用仅仅 20 MB 左右. CPU 占用率则跟网络流量正相关, 没有流量的情况下, Windows 版本 CPU 占用率接近 0% ( 2010 年的 Thinkpad ), macOS则是在 5% 以下 ( 2014 年的中端 13 寸 Macbook ).\n\n#### 优缺点\n\n优点:\n\n- 可以实现 TCP / UDP 的透明代理\n- 性能强\n- 便携性强\n- 切换方便\n- 免费, 开源\n\n缺点:\n\n- 依赖 VirtualBox\n- 无法服务局域网内的其他设备\n- UI 用 Electron 进行封装, 体积比虚拟机大太多\n- [ Windows ] Windows 改了默认路由后, Edge 浏览器和 UWP 应用无法连接网络. 其他应用则不受影响\n\n### 拓扑结构\n\n![topology](./doc/topology.jpg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fovercache%2Fvrouter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fovercache%2Fvrouter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fovercache%2Fvrouter/lists"}