Telegram socks5 proxy server based on Cloudflare Workers/Pages.
Written in Rust! 🦀
git clone https://github.com/achyuki/cfproxy-rs.git
cd cfproxy-rs
cargo build --releaseBefore using it, you need to deploy this project on Cloudflare workers or pages.
- Fork this repository
- Deploy on Cloudflare pages
- Configure
TOKEN in environment variable
# Use a configuration file:
cfproxy-rs --config config.json
# Or via command-line arguments:
cfproxy-rs --cfhost <domain> --token <token> --loglevel debugFor more information, see cfproxy-rs --help.
Here is a complete configuration example.
// config_full.json
// Don't save with comments, it will not be parsed!!
{
"cfhost": "xxxx.pages.dev", // Cloudflare workers/pages domain [Required]
"cfip": "104.16.0.0", // Cloudflare IP, generally no changes are required, or via https://github.com/XIU2/CloudflareSpeedTest
"token": "", // Authentication token
"host": "127.0.0.1", // SOCKS5 bind address
"port": 4514, // SOCKS5 bind port
"user": "", // SOCKS5 username
"passwd": "", // SOCKS5 password
"log": "", // Log saving path
"loglevel": "info" // Log level (error/warn/info/debug/trace)
}
- Due to issues with Cloudflare, outbound TCP sockets to Cloudflare IP ranges are temporarily blocked.
- Due to Cloudflare does not support it, UDP proxy is not supported yet.
- As UDP DNS queries have not been processed yet, it currently only supports IP access, such as Telegram.
- 中国大陆用户请使用 Pages 部署.
- Support ~~UDP proxy/~~DNS query
- Calling proxychains-ng/graftcp
MIT License
Copyright (c) 2025 YukiChan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.