@@ -30,6 +30,7 @@ GitHub: https://github.com/shadowy-pycoder/go-http-proxy-to-socks
3030
3131Usage: gohpts [OPTIONS]
3232OPTIONS:
33+ General:
3334 -h Show this help message and exit
3435 -v Show version and build information
3536 -D Run as a daemon (provide -logfile to see logs)
@@ -64,6 +65,8 @@ const usageTproxy string = `
6465 -T Address of transparent proxy server (no HTTP)
6566 -Tu Address of transparent UDP proxy server
6667 -M Transparent proxy mode: (redirect, tproxy)
68+ -w Number of instances of transparent proxy server (Default: number of CPU cores)
69+ -wu Number of instances of transparent UDP proxy server (Default: number of CPU cores)
6770 -auto Automatically setup iptables for transparent proxy (requires elevated privileges)
6871 -arpspoof Enable ARP spoof proxy for selected targets (Example: "targets 10.0.0.1,10.0.0.5-10,192.168.1.*,192.168.10.0/24;fullduplex false;debug true")
6972 -mark Set mark for each packet sent through transparent proxy (Default: redirect 0, tproxy 100)
@@ -117,6 +120,18 @@ func root(args []string) error {
117120 conf .TProxyMode = flagValue
118121 return nil
119122 })
123+ flags .UintVar (
124+ & conf .TProxyWorkers ,
125+ "w" ,
126+ 0 ,
127+ "Number of instances of transparent proxy server (Default: number of CPU cores)" ,
128+ )
129+ flags .UintVar (
130+ & conf .TProxyUDPWorkers ,
131+ "wu" ,
132+ 0 ,
133+ "Number of instances of transparent UDP proxy server (Default: number of CPU cores)" ,
134+ )
120135 flags .BoolVar (
121136 & conf .Auto ,
122137 "auto" ,
@@ -199,9 +214,14 @@ func root(args []string) error {
199214 return fmt .Errorf ("transparent proxy mode requires -t, -T or -Tu flag" )
200215 }
201216 }
202- if seen ["auto" ] {
203- if ! seen ["t" ] && ! seen ["T" ] && ! seen ["Tu" ] {
204- return fmt .Errorf ("-auto requires -t, -T or -Tu flag" )
217+ if seen ["w" ] {
218+ if ! seen ["t" ] && ! seen ["T" ] {
219+ return fmt .Errorf ("-w requires -t, or -T flag" )
220+ }
221+ }
222+ if seen ["wu" ] {
223+ if ! seen ["Tu" ] {
224+ return fmt .Errorf ("-wu requires -Tu flag" )
205225 }
206226 }
207227 if seen ["mark" ] {
0 commit comments