Skip to content

Instantly share code, notes, and snippets.

View yushum's full-sized avatar
🤓
I may be slow to respond.

Yusum yushum

🤓
I may be slow to respond.
View GitHub Profile
@phlinhng
phlinhng / a-clash-tproxy-gateway.md
Last active June 2, 2024 09:55
Clash as transparent proxy gateway via TPROXY

Notes

  1. If your local network use public IP ranges instead of private ones, make sure to add respecive RETURN rules to iptables to prevent looping issue
  2. Set clash as DHCP's only DNS server to allow domain-based filter (shunting) rules work
  3. Use lsof -i udp:53 to check if clash's DNS module work fine, otherwise you may have to kill systemd-resolved and any other processes occupying the UDP 53 port
  4. The given scripts will NOT hangle the traffic of gateway itself since it is not recommend to do so. If you want to redirect the egress traffic of the gateway, the following material may be useful

Reference

@liberal-boy
liberal-boy / 代理服务器 Cake 队列规则常用参数推荐.md
Last active April 26, 2024 00:09
代理服务器 Cake 队列规则常用参数推荐

代理服务器 Cake 队列规则常用参数推荐

  • 注意,BBR 等基于延迟判断发送窗口的拥塞控制算法可能与 AQM 发生冲突!!!对于使用 BBR 的设备,fq 可能还是最好的选择。

为什么选用 Cake

Cake 使用主动队列管理(AQM)技术保持全局同步,可以控制延迟,有效利用宽带。同时它还可以保证每个主机,每个流公平的分享宽带。

使用 Cake 的条件

Cake 与 kernel 4.19 并入主线,因此使用 Cake 需要 kernel 和 iproute2 版本大于 4.19。如何确认 kernel 和 iproute2 版本,以及如何升级本文不做详细说明。

@liberal-boy
liberal-boy / HaProxy 通过 Domain Socket 与 V2Ray 通讯.md
Last active September 5, 2023 19:46
HaProxy 通过 Domain Socket 与 V2Ray 通讯

HaProxy 通过 Domain Socket 与 V2Ray 通讯

本文供高级玩家阅读,请先阅读 Vmess + TCP + TLS 方式的 HTTP 分流和网站伪装。 相比 TCP,Domain Socket 更为高效。 本文针对使用 Debian 10 的用户,其他系统请自行摸索。

预先准备

  1. 首先按照先前的教程安装好 HaProxy 和 V2Ray。

  2. 修改以下文件,示例见下方

  • /etc/haproxy/haproxy.cfg
@lixingcong
lixingcong / sysctl.conf
Last active December 1, 2023 12:26
适用于个人的Linux VPS内核调优
# source from phuslu
# https://phus.lu/sysctl.conf
# bbr
net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr
net.ipv4.tcp_retries2 = 8
# 系统所有进程一共可以打开的文件数量, 每个套接字也占用一个文件描述字