All Projects → talkincode → ToughProxy

talkincode / ToughProxy

Licence: LGPL-3.0 License
ToughProxy 是一个代理服务器, 目标是提供一个综合性的代理服务软件,支持 socks5,socks4, http, https代理协议, 针对 Socks5 提供完善的认证机制,以及提供流量控制策略,访问控制策略。

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects
java
68154 projects - #9 most used programming language
python
139335 projects - #7 most used programming language
shell
77523 projects
HTML
75241 projects

Projects that are alternatives of or similar to ToughProxy

Shadowsocks Rust
A Rust port of shadowsocks
Stars: ✭ 3,455 (+7752.27%)
Mutual labels:  http-proxy, socks5, socks4
ProxyChecker
An easy to use open-source, multithreaded Proxy Checker. Allows you to quickly check HTTP and SOCKS proxies in a user friendly GUI, for Windows, Mac OS, Linux.
Stars: ✭ 113 (+156.82%)
Mutual labels:  http-proxy, socks5, socks4
aiohttp-socks
Proxy (HTTP, SOCKS) connector for aiohttp
Stars: ✭ 147 (+234.09%)
Mutual labels:  socks5, socks4
Prox5
🧮 SOCKS5/4/4a 🌾 validating proxy pool and upstream SOCKS5 server for 🤽 LOLXDsoRANDum connections 🎋
Stars: ✭ 39 (-11.36%)
Mutual labels:  socks5, socks4
goproxy
🍉 a proxy with go,supports http,socks4/5 at the same time.
Stars: ✭ 27 (-38.64%)
Mutual labels:  socks5, socks4
Httpproxy
http代理,支持CONNECT和普通GET/POST,支持http2;可防止主动嗅探;可作为小火箭、圈、surge等软件和SwitchyOmega(chrome插件)所说的https代理
Stars: ✭ 104 (+136.36%)
Mutual labels:  netty, http-proxy
nimSocks
A filtering SOCKS proxy server and client library written in nim.
Stars: ✭ 51 (+15.91%)
Mutual labels:  socks5, socks4
python-socks
Core proxy client (SOCKS4, SOCKS5, HTTP) functionality for Python
Stars: ✭ 40 (-9.09%)
Mutual labels:  socks5, socks4
Eagle.tunnel.go
稳定的代理工具,比.NET版本更轻量和易用
Stars: ✭ 143 (+225%)
Mutual labels:  http-proxy, socks5
SocksSharp
SocksSharp provides support for Socks4/4a/5 proxy servers to HttpClient
Stars: ✭ 75 (+70.45%)
Mutual labels:  socks5, socks4
3proxy
3proxy - tiny free proxy server
Stars: ✭ 2,493 (+5565.91%)
Mutual labels:  socks5, socks4
ProxyGrab
Asynchronous Library made using Python and aiohttp to get proxies from multiple services!
Stars: ✭ 17 (-61.36%)
Mutual labels:  socks5, socks4
Nitmproxy
Proxy server based on netty
Stars: ✭ 94 (+113.64%)
Mutual labels:  netty, http-proxy
Nettygateway
NettyGateway is a HTTP proxy server with flexible routing rules.
Stars: ✭ 73 (+65.91%)
Mutual labels:  netty, http-proxy
Mubeng
An incredibly fast proxy checker & IP rotator with ease.
Stars: ✭ 234 (+431.82%)
Mutual labels:  http-proxy, socks5
LiveProxies
Asynchronous proxy checker
Stars: ✭ 17 (-61.36%)
Mutual labels:  http-proxy, socks5
FullProxy
Bind and reverse connection based, SOCKS5, HTTP and PortForward based portable proxy
Stars: ✭ 22 (-50%)
Mutual labels:  http-proxy, socks5
Flynet
A powerful TCP/UDP tool, which support socks5 proxy by tcp and udp, http proxy and NAT traversal. This tool can help you bypass gfw easily
Stars: ✭ 124 (+181.82%)
Mutual labels:  http-proxy, socks5
Qtnetworkng
QtNetwork Next Generation. A coroutine based network framework for Qt/C++, with more simpler API than boost::asio.
Stars: ✭ 125 (+184.09%)
Mutual labels:  http-proxy, socks5
Pummel
Socks5 Proxy HTTP/HTTPS-Flooding (cc) attack
Stars: ✭ 53 (+20.45%)
Mutual labels:  http-proxy, socks5

****

ToughProxy

ToughProxy 是一个代理服务器, 目标是提供一个综合性的代理服务软件,支持 socks5,socks4, http, https代理协议, 针对 Socks5 提供完善的认证机制,以及提供流量控制策略,访问控制策略。

基础功能清单

  • Socks5 代理(支持UDP穿透)
  • Socks4 代理
  • Http代理
  • Https代理
  • Socks5 Radius 认证, 支持下发限速扩展
  • Socks5 数据库认证
  • 认证用户管理,批量创建用户支持,用户组支持
  • 全局限速和单个连接限速
  • 连接数控制
  • 源地址,目标地址,域名访问控制
  • 实时连接会话查询,实时流量统计
  • 连接日志存档查询,可自定义保存天数
  • Http APi 提供

快速开始

注意, linux 下提供了快捷安装脚本,请参考安装包内的 linux-installer.md

系统环境依赖

  • 操作系统:支持跨平台部署 (Linux,Windows,MacOS等)
  • java 版本: 1.8或更高
  • 数据库服务器:MySQL/MariaDB

数据库初始化

数据库的安装配置请自行完成,首先确保你的数据库服务器已经运行

运行创建数据库脚本以及创建专用用户

create database toughproxy DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
GRANT ALL ON toughproxy.* TO proxyuser@'127.0.0.1' IDENTIFIED BY 'proxypwd' WITH GRANT OPTION;FLUSH PRIVILEGES;

创建数据库表

USE `toughproxy`;

-- 表 toughproxy.ts_acl 结构
CREATE TABLE IF NOT EXISTS `ts_acl` (
  `id` bigint(20) unsigned NOT NULL,
  `priority` int(10) unsigned NOT NULL DEFAULT '0',
  `status` int(10) unsigned NOT NULL DEFAULT '1',
  `hits` int(10) unsigned NOT NULL DEFAULT '0',
  `policy` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `src` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `target` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `domain` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


-- 表 toughproxy.ts_config 结构
CREATE TABLE IF NOT EXISTS `ts_config` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `type` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL,
  `value` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `remark` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- 表 toughproxy.ts_group 结构
CREATE TABLE IF NOT EXISTS `ts_group` (
  `id` bigint(20) unsigned DEFAULT NULL,
  `name` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` int(10) unsigned NOT NULL DEFAULT '1',
  `up_limit` int(10) unsigned DEFAULT NULL,
  `down_limit` int(10) unsigned DEFAULT NULL,
  `max_session` int(10) unsigned DEFAULT NULL,
  `remark` varchar(512) COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- 表 toughproxy.ts_user 结构
CREATE TABLE IF NOT EXISTS `ts_user` (
  `id` bigint(20) unsigned DEFAULT NULL,
  `group_id` bigint(20) unsigned DEFAULT NULL,
  `group_policy` int(10) unsigned DEFAULT NULL,
  `realname` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `username` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `password` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mobile` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` int(10) unsigned DEFAULT NULL,
  `up_limit` int(10) unsigned DEFAULT NULL,
  `down_limit` int(10) unsigned DEFAULT NULL,
  `max_session` int(10) unsigned DEFAULT NULL,
  `create_time` timestamp NULL DEFAULT NULL,
  `update_time` timestamp NULL DEFAULT NULL,
  `expire_time` timestamp NULL DEFAULT NULL,
  `remark` varchar(512) COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

运行主程序

java -jar -Xms256M -Xmx1024M /opt/toughproxy-latest.jar  --spring.profiles.active=prod

注意 jar 文件(toughproxy-latest.jar)的路径

Linux systemd 服务配置

/opt/application-prod.properties

# web访问端口
server.port = 1823

# 日志配置,可选 logback-prod.xml 或 logback-dev.xml, 日志目录为 /var/toughproxy/logs
logging.config=classpath:logback-prod.xml

# 数据库配置
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/toughproxy?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8
&allowMultiQueries
=true
spring.datasource.username=proxyuser
spring.datasource.password=proxypwd
spring.datasource.max-active=120
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

/usr/lib/systemd/system/toughproxy.service

[Unit]
Description=toughproxy
After=syslog.target

[Service]
WorkingDirectory=/opt
User=root
LimitNOFILE=65535
LimitNPROC=65535
Type=simple
ExecStart=/usr/bin/java -server -jar -Xms256M -Xmx1024M /opt/toughproxy-latest.jar  --spring.profiles.active=prod
SuccessExitStatus=143

[Install]
WantedBy=multi-user.target

如果了解 spring systemd和配置原理,可以根据自己的实际需要进行修改

通过以下指令启动服务

systemctl enable toughproxy
systemctl start toughproxy

WEB 管理访问

打开浏览器访问 http://服务器地址:1823

进入登录页面, 默认管理员用户名密码 admin root

意见反馈

如您有好的建议想法, 请加入 QQ 群 247860313 交流

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].