{"id":13845974,"url":"https://github.com/gfreezy/seeker","last_synced_at":"2025-06-24T03:12:18.845Z","repository":{"id":243994418,"uuid":"196743561","full_name":"gfreezy/seeker","owner":"gfreezy","description":"通过使用 tun 来实现透明代理。实现了类似 surge 增强模式与网关模式。","archived":false,"fork":false,"pushed_at":"2025-06-09T11:12:07.000Z","size":1830,"stargazers_count":54,"open_issues_count":5,"forks_count":9,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-09T12:25:09.887Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gfreezy.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-07-13T16:33:53.000Z","updated_at":"2025-06-09T11:12:11.000Z","dependencies_parsed_at":"2024-07-25T12:15:03.377Z","dependency_job_id":"357bfa55-b42b-4b29-ba6b-e1ec41f93028","html_url":"https://github.com/gfreezy/seeker","commit_stats":null,"previous_names":["gfreezy/seeker"],"tags_count":97,"template":false,"template_full_name":null,"purl":"pkg:github/gfreezy/seeker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfreezy%2Fseeker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfreezy%2Fseeker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfreezy%2Fseeker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfreezy%2Fseeker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gfreezy","download_url":"https://codeload.github.com/gfreezy/seeker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfreezy%2Fseeker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261595784,"owners_count":23182249,"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":[],"created_at":"2024-08-04T17:04:14.531Z","updated_at":"2025-06-24T03:12:18.820Z","avatar_url":"https://github.com/gfreezy.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"= Seeker\n\nimage::https://github.com/gfreezy/seeker/actions/workflows/release.yml/badge.svg[]\nimage::https://github.com/gfreezy/seeker/actions/workflows/ci.yml/badge.svg?branch=master[]\n\n\n使用 Tun 实现透明代理（支持 Mac \u0026 Linux 系统），支持 TCP、UDP。\n\n== Slack\nhttps://join.slack.com/t/allsunday/shared_invite/zt-f8xw3uzl-qchMa2jQOfQF1T89w3lfiw\n\n== Download\n访问 https://github.com/gfreezy/seeker/releases 下载最新 release\n\n[source,bash]\n----\nchmod +x seeker-osx  # or  chmod+x seeker-linux\n----\n== Usage\n\n1. 启动 `seeker`\n+\n[source,bash]\n----\nSeeker 0.5.0\ngfreezy \u003cgfreezy@gmail.com\u003e\nTun to Shadowsockets proxy. https://github.com/gfreezy/seeker\n\nUSAGE:\n    seeker [FLAGS] [OPTIONS]\n\nFLAGS:\n        --encrypt    Encrypt config file and output to terminal\n    -h, --help       Prints help information\n    -V, --version    Prints version information\n\nOPTIONS:\n    -c, --config \u003cFILE\u003e              Sets config file. Sample config at\n                                     https://github.com/gfreezy/seeker/blob/master/sample_config.yml\n        --config-url \u003cCONFIG_URL\u003e    URL to config\n        --key \u003cKEY\u003e                  Key for encryption/decryption\n    -l, --log \u003cPATH\u003e                 Log file\n    -u, --uid \u003cUID\u003e                  User id to proxy\n----\n+\n本地配置文件启动\n+\n[source,bash]\n----\nsudo seeker --config path/to/config.yml\n----\n+\n远程配置文件启动\n+\n[source,bash]\n----\nsudo seeker --config-url https://pastebin.com/raw/config --key encrypt-key\n----\n+\n生成远程配置文件\n+\n[source,bash]\n----\nsudo seeker --config path/to/config.yml --encrypt --key encrypt-key\n----\n\n2. `seeker` 启动的时候会自动将本机 DNS 修改为 `127.0.0.1`，退出的时候将 DNS 设置为默认值\n\n== Config\n\n* `seeker` 直接使用的 clash 的规则。目前支持 `DOMAIN` `DOMAIN-KEYWORD` `DOMAIN-SUFFIX` `MATCH` 规则，不支持 `IP` 相关的规则。\n* 支持的 `Action`:\n* `PROXY(proxy-group-name)` 走 proxy-group-name 代理组\n* `DIRECT` 直连\n* `REJECT` 拒绝\n* `PROBE(proxy-group-name)` 默认尝试直连，如果超时，则走 proxy-group-name 代理组。\n* 确保系统没有重复的 `tun_name`\n* 确保 TUN 的网络 `tun_ip` 和 `tun_cidr` 与当前所处网络环境不在一个网段\n* `seeker` 支持 socks5 代理、http 代理和 shadowsocks 代理。优先级为 socks5 代理 \u003e shadowsocks 代理 \u003e http 代理。\n* `redir` 模式下使用 iptables 的 redirect 功能，只支持 tcp 流量。\n\n\n=== Sample Config\nhttps://github.com/gfreezy/seeker/blob/master/sample_config.yml\n\n里面有详细的配置文件说明。\n\n=== 支持的 method\n```\nTable\nPlain\n\nAes128Cfb\nAes128Cfb1\nAes128Cfb8\nAes128Cfb128\nAes192Cfb\nAes192Cfb1\nAes192Cfb8\nAes192Cfb128\nAes256Cfb\nAes256Cfb1\nAes256Cfb8\nAes256Cfb128\nAes128Ctr\nAes192Ctr\nAes256Ctr\n\nCamellia128Cfb\nCamellia192Cfb\nCamellia256Cfb\nCamellia128Cfb1\nCamellia192Cfb1\nCamellia256Cfb1\nCamellia128Cfb8\nCamellia192Cfb8\nCamellia256Cfb8\nCamellia128Cfb128\nCamellia192Cfb128\nCamellia256Cfb128\n\nRc4\nRc4Md5\n\nChaCha20\nSalsa20\nXSalsa20\nChaCha20Ietf\n\nAes128Gcm\nAes256Gcm\n\nChaCha20IetfPoly1305\nXChaCha20IetfPoly1305\n\nAes128PmacSiv\nAes256PmacSiv\n```\n== ⚠️使用 Socks5 或 http 代理服务器\n使用 socks5 代理的时候，需要将所有直连的域名设置在配置文件里面，如果使用 ss 或者 vmess 之类的，需要将 ss 或 vmess server\n的域名也加入配置文件。否则有可能会导致死循环，没法正常使用。\n\n⚠️ http 代理只支持 `CONNECT` 协议，而且不支持 UDP 协议。\n\n== 指定 IP 或某网段走代理\n在配置文件中增加 `IP-CIDR` 规则即可。默认情况下 IP 都是是直连，所以只需要添加 `PROXY` 和 `PROBE`。如下：\n\n[source,yaml]\n----\nrules:\n  - 'IP-CIDR,19.23.212.0/16,PROXY'\n  - 'IP-CIDR,19.23.21.0/16,PROBE'\n----\n\n== 代理局域网内其他机器\n1. 打开 `gateway_mode`。`gateway_mode` 开启后， `dns_server` 会自动覆盖为 `0.0.0.0:53`\n+\n[source,yaml]\n----\ngateway_mode: true\n----\n\n2. 查看本地 IP\n+\n[source,shell script]\n----\nifconfig\n----\n\n3. 打开希望走代理的手机或者电脑的网络设置，将 **DNS** 与 **网关** 修改为步骤2获取到的 IP\n\n\n== 重置 DNS 分配\n\n[source,bash]\n----\nrm -rf seeker.sqlite\n----\n\n\n== FAQ\n. If you encountered `\"seeker\" cannot be opened because the developer cannot be verified.`,\nyou can go to `System Preferences` -\u003e `Security \u0026 Privacy` -\u003e `General` and enable any\nblocked app from Allow apps downloaded from pane at the bottom of the window.\n\n. Ubuntu 提示 `Address already used`, 查看这里 https://unix.stackexchange.com/questions/304050/how-to-avoid-conflicts-between-dnsmasq-and-systemd-resolved\n\n== Build (latest stable)\n\n[source,bash]\n----\ngit clone https://github.com/gfreezy/seeker.git\ncd seeker\nOPENSSL_STATIC=yes cargo build --release\n----\n\n编译完成后，程序在 `target/release/seeker`。\n\n=== musl 编译\n\n[source,shell]\n----\ndocker run -v $PWD:/volume -e OPENSSL_STATIC=yes --rm -t clux/muslrust cargo build --release\n----\n\n会在 `target/x86_64-unknown-linux-musl/release` 目录下生成 `seeker` 文件。\n\n\n== 实现原理\n`seeker` 参考了 `Surge for Mac` 的实现原理，基本如下：\n\n. `seeker` 会在本地启动一个 DNS server，并自动将本机 DNS 修改为 `seeker` 的 DNS 服务器地址\n. `seeker` 会创建一个 TUN 设备，并将 IP 设置为 `10.0.0.1`，系统路由表设置 `10.0.0.0/16` 网段都路由到 TUN 设备\n. 有应用请求 DNS 的时候， `seeker` 会为这个域名返回 `10.0.0.0/16` 网段内一个唯一的 IP\n. `seeker` 从 TUN 接受到 IP 包后，会在内部组装成 TCP/UDP 数据\n. `seeker` 会根据规则和网络连接的 uid 判断走代理还是直连\n. 如果需要走代理，将 TCP/UDP 数据转发到 SS 服务器/ socks5 代理，从代理接受到数据后，在返回给应用；如果直连，则本地建立直接将数据发送到目标地址\n\n\n== 如何发布新版本\n```\n$ cargo install cargo-release\n$ ./add-tag.sh\n```\n\nGithub Action 会自动编译并发布新的 release。\n\n== License\n\nLicensed under either of\n\n* Apache License, Version 2.0\n([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n* MIT license\n([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n== Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgfreezy%2Fseeker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgfreezy%2Fseeker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgfreezy%2Fseeker/lists"}