Add -tls-proxy-outbound-port flag to jafar (useful for non-HTTPS protocols)

Edit README to make it explicit that tlsproxy has nothing to do with HTTP and can be
used with any TCP protocol that does TLS handshakes.
This commit is contained in:
ooni noob 2022-11-23 10:56:06 +01:00
commit 508c4293d5
4 changed files with 26 additions and 13 deletions

View file

@ -58,8 +58,9 @@ var (
tag *string
tlsProxyAddress *string
tlsProxyBlock flagx.StringArray
tlsProxyAddress *string
tlsProxyBlock flagx.StringArray
tlsProxyOutboundPort *string
uncensoredResolverDoH *string
)
@ -159,12 +160,16 @@ func init() {
// tlsProxy
tlsProxyAddress = flag.String(
"tls-proxy-address", "127.0.0.1:443",
"Address where the HTTP proxy should listen",
"Address where the TCP+TLS proxy should listen",
)
flag.Var(
&tlsProxyBlock, "tls-proxy-block",
"Register keyword triggering TLS censorship",
)
tlsProxyOutboundPort = flag.String(
"tls-proxy-outbound-port", "443",
"The outbound port where requests should be proxied",
)
// uncensored
uncensoredResolverDoH = flag.String(
@ -227,7 +232,7 @@ func iptablesStart() *iptables.CensoringPolicy {
}
func tlsProxyStart(uncensored *uncensored.Client) net.Listener {
proxy := tlsproxy.NewCensoringProxy(tlsProxyBlock, uncensored)
proxy := tlsproxy.NewCensoringProxy(tlsProxyBlock, uncensored, tlsProxyOutboundPort)
listener, err := proxy.Start(*tlsProxyAddress)
runtimex.PanicOnError(err, "proxy.Start failed")
return listener