Skip to content

Instantly share code, notes, and snippets.

View bash99's full-sized avatar

Ben Rood bash99

View GitHub Profile
@SilverBut
SilverBut / haproxy.cfg
Last active May 19, 2023 20:45
[Haproxy cfg checking Socks5] Haproxy cfg to check the Socks5 connection #tags: GFW, network, haproxy, config
#---------------------------------------------------------------------
# Example configuration for a possible web application. See the
# full configuration options online.
#
# http://haproxy.1wt.eu/download/1.4/doc/configuration.txt
#
#---------------------------------------------------------------------
global
log 127.0.0.1 local2
@kriswebdev
kriswebdev / novpn.sh
Last active April 9, 2024 06:24
novpn: Bypass VPN for specific apps [Linux / OpenVPN]
#!/bin/bash
# === INFO ===
# NoVPN
# Description: Bypass VPN tunnel for applications run through this tool.
VERSION="3.0.0"
# Author: KrisWebDev
# Requirements: Linux with kernel > 2.6.4 (released in 2008).
# This version is tested on Ubuntu 14.04 and 19.10 with bash.
# Main dependencies are automatically installed.
# 生成 socks5 协议的连接命令16进制数据,用于 haproxy的 tcp-check send-binary
# 参考:
# - <https://zh.wikipedia.org/wiki/SOCKS#SOCKS5>, "SOCKS5请求格式" 部分
# - <http://cbonte.github.io/haproxy-dconv/configuration-1.7.html#4.2-tcp-check%20send-binary>
socks5_connect_binary = lambda domain, port: "05010003"+"%02x" % len(domain)+"".join(["%02x" % ord(x) for x in domain])+"%04x" % int(port)