{"id":21039859,"url":"https://github.com/qwq233/ua4f","last_synced_at":"2025-05-15T16:32:56.923Z","repository":{"id":261968330,"uuid":"864494823","full_name":"qwq233/UA4F","owner":"qwq233","description":"Another User Agent faker, allowing users to bypass multi device detection for Campus Network via socks5 proxy.","archived":false,"fork":false,"pushed_at":"2024-12-04T09:46:51.000Z","size":85,"stargazers_count":8,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-03T11:38:10.389Z","etag":null,"topics":["campus-network","http","openwrt","openwrt-package","openwrt-zh-cn","proxy","socks5"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qwq233.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2024-09-28T11:20:29.000Z","updated_at":"2024-12-25T10:18:10.000Z","dependencies_parsed_at":"2024-11-09T16:28:06.323Z","dependency_job_id":"ec06b23b-44ef-49e7-8352-8a20b508f8b9","html_url":"https://github.com/qwq233/UA4F","commit_stats":null,"previous_names":["qwq233/ua4f"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qwq233%2FUA4F","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qwq233%2FUA4F/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qwq233%2FUA4F/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qwq233%2FUA4F/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qwq233","download_url":"https://codeload.github.com/qwq233/UA4F/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254377361,"owners_count":22061125,"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":["campus-network","http","openwrt","openwrt-package","openwrt-zh-cn","proxy","socks5"],"created_at":"2024-11-19T13:43:57.480Z","updated_at":"2025-05-15T16:32:56.628Z","avatar_url":"https://github.com/qwq233.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UA4F\n\n[中文](./README_CN.md)\n\nAnother User Agent faker, allowing users to bypass multi device detection for Campus Network via socks5 proxy.\n\nInspired by [UA3f](https://github.com/SunBK201/UA3F)\n\n\u003e [!WARNING]\n\u003e This is a toy project. No ANY guarantees are made regarding performance or stability.\n\n# Features\n\n- Better performence ~~(i guess)~~\n- Fully written in ***rust***\n- Easy to migrate from ua3f\n- Compatible with clash\n\n# Principle\n\nIt will first grab the first few bytes of the first packet to check if it is http traffic. If so, it will continue to grab a total of about 4k of traffic and modify the User Agent in it.\n\n# Install\n\n## Using prebuilt package\n\nYou can find most common pre-built packages in [Release](https://github.com/qwq233/UA4F/releases).\n\nDownload and install it. Then you are ready to use it.\n\n## Build Manually\n\n1. Make sure you have installed latest **nightly** version of rust toolchain and the target corresponding to the target platform. (E.G: `x86_64-unknown-linux-musl` for x86_64 OpenWrt platform or `x86_64-unknown-linux-gnu` for x86_64 GNU/Linux)\n\n2. Clone this project\n\n3. Build with `cargo`\n\n4. You are ready to use. The build result is usually located in `target/TARGET_ARCH/release/ua4f`\n\n#### Example Command\n\n```shell\n# Assuming you are using rustup to manage rust toolchain\nrustup default nightly\nrustup add x86_64-unknown-linux-musl\n\ncargo build --release --target x86_64-unknown-linux-musl\n```\n\n## Build with OpenWrt\n\n1. Make sure you have installed latest **nightly** version of rust toolchain and the target corresponding to the target platform and use musl as the C library. (E.G: `x86_64-unknown-linux-musl` for x86_64 platform)\n\n2. Clone this project into the `package/ua4f`\n\n3. Enable building luci-compat and ua4f package\n\n4. You are ready to build the image or build the package separately.\n\n#### Example Command\n\n```shell\n# Assuming you are using rustup to manage rust toolchain\nrustup default nightly\nrustup target add x86_64-unknown-linux-musl\n\necho \"CONFIG_PACKAGE_ua4f=y\" \u003e\u003e .config\nmake defconfig\n\n# Build this package only\nmake package/ua4f/{clean,compile} V=s -j$(nproc)\n# or include in the image\nmake -j$(nproc)\n```\n\n# Configure\n\n## By Luci\n\nIt can easily configured via luci. The configuration page is located at `Service -\u003e UA4F`\n\n## By command\n\nAssuming you are using OpenWrt. You can run these command to configure and start it as background service.\n\n```shell\n# Custom UA\nuci set ua4f.main.ua=\"Mozilla/5.0 (Window NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/555.66\"\n# Listen port\nuci set ua4f.main.port=\"1080\"\n# Bind address\nuci set ua4f.main.bind=\"127.0.0.1\"\n# Log level\nuci set ua4f.main.log_level=\"info\"\n\n# Apply\nuci commit ua3f\n\n# Start service\nservice ua4f enable\nservice ua4f start\n```\n\n## By systemd\n\nFor regular distributions (Like ***Arch Linux***), you will most likely use systemd to manage background services.\n\nIn this situation, you need to write the systemd service file. But don't worry, I have provided an example file and just modify it according to your needs.\n\n1. Create file in `/etc/systemd/system/multi-user.target.wants/ua4f.service`\n\n2. Copy these lines below and modify it according your needs.\n\n```ini\n[Unit]\nDescription=Another User Agent faker, allowing users to bypass multi device detection for Campus Network via socks5 proxy.\nDocumentation=https://github.com/qwq233/ua4f/\nAfter=network.target\n\n[Install]\nWantedBy=multi-user.target\n\n[Service]\n# Configure part\nEnvironment=bind_address=127.0.0.1\nEnvironment=port=1080\nEnvironment=custom_ua=Mozilla/5.0 (Window NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/555.66\nEnvironment=log_level=info\n\n# Prevent writes to /usr, /boot, and /etc\nUser=nobody\nProtectSystem=full\n# Prevent accessing /home, /root and /run/user\nProtectHome=true\n\n# Allow modify log file\nReadWritePaths=-/var/log/\n\nType=simple\n\nExecStart=/path/to/ua4f -b \"$bind_address\" -l \"$log_level\" -p \"$port\" -f \"$custom_ua\"\nKillSignal=SIGTERM\nRestart=on-abort\nRestartSec=5s\n\n```\n\n3. Enable and start the service\n\n#### Example Command\n\n```shell\n# Download the unit file (same content as above)\ncurl https://github.com/qwq233/UA4F/raw/refs/heads/master/misc/ua4f.service -0 -o /etc/systemd/system/multi-user.target.wants/ua4f.service\n\n# Edit the file\nvim /etc/systemd/system/multi-user.target.wants/ua4f.service\n\n# Enable and start the service\nsystemctl enable ua4f.service\nsystemctl start ua4f.service\n```\n\n# License\n\n**AGPL-3.0-or-later**\n\n```\nUA4F - Another User Agent faker\nCopyright (C) 2024  James Clef \u003cqwq233@qwq2333.top\u003e\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU Affero General Public License as\npublished by the Free Software Foundation, either version 3 of the\nLicense, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU Affero General Public License for more details.\n\nYou should have received a copy of the GNU Affero General Public License\nalong with this program.  If not, see \u003chttps://www.gnu.org/licenses/\u003e.\n```\n\n# Credit\n\nSome luci code from [UA3F](https://github.com/SunBK201/UA3F)\n\nLicense: `GPL-3.0-only`\n```\nUA3f\nCopyright (C) 2024  SunBK201\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program.  If not, see \u003chttps://www.gnu.org/licenses/\u003e.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqwq233%2Fua4f","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqwq233%2Fua4f","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqwq233%2Fua4f/lists"}