Skip to content

Instantly share code, notes, and snippets.

View hsupu's full-sized avatar
🌏
Inside

Hsu Pu hsupu

🌏
Inside
View GitHub Profile
@hsupu
hsupu / iptables-tproxy-for-ss-redir.sh
Last active April 19, 2022 04:49
OpenWRT: iptables transparent proxy script for ss-redir
LAN_IF=wan1
SS_PORT=1088
SSS_HOST=
SSS_PORT=
SSS_METHOD=
SSS_PASS=
iptables -t nat -N ss
iptables -t nat -F ss
iptables -t nat -A ss -d 127.0.0.0/8 -j RETURN # loopback
@hsupu
hsupu / nat6-and-port-forwarding.sh
Last active May 14, 2023 14:52
OpenWRT: iptables rules: NAT6 and Port Forwarding
LAN_IF=br-lan
WAN_IF=eth2
# nat6
ip6tables -t nat -I POSTROUTING -o $WAN_IF -j MASQUERADE
function forward6() {
PROTO=$1
ROUTER_PORT=$2
HOST_IP=$3
@hsupu
hsupu / httpclient-demo.ps1
Last active March 23, 2021 00:17
PowerShell HttpClient ServerCertificateCustomValidationCallback demo
$cscode = @"
using System;
using System.Net.Http;
using System.Net.Security;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Text;
public class My {