-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #91 from Snawoot/optional-sni-hide
option to disable SNI hide
- Loading branch information
Showing
4 changed files
with
22 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,6 +64,7 @@ type CLIArgs struct { | |
maxPause time.Duration | ||
backoffInitial time.Duration | ||
backoffDeadline time.Duration | ||
hideSNI bool | ||
} | ||
|
||
func parse_args() CLIArgs { | ||
|
@@ -93,6 +94,7 @@ func parse_args() CLIArgs { | |
"Format: <http|https|socks5|socks5h>://[login:password@]host[:port] "+ | ||
"Examples: http://user:[email protected]:3128, socks5://10.0.0.1:1080") | ||
flag.StringVar(&args.caFile, "cafile", "", "use custom CA certificate bundle file") | ||
flag.BoolVar(&args.hideSNI, "hide-SNI", true, "hide SNI in TLS sessions with proxy server") | ||
flag.Parse() | ||
if args.country == "" { | ||
arg_fail("Country can't be empty string.") | ||
|
@@ -215,8 +217,8 @@ func run() int { | |
mainLogger.Critical("Unable to determine proxy endpoint: %v", err) | ||
return 5 | ||
} | ||
handlerDialer := NewProxyDialer(endpoint.NetAddr(), endpoint.TLSName, caPool, auth, dialer) | ||
requestDialer := NewPlaintextDialer(endpoint.NetAddr(), endpoint.TLSName, caPool, dialer) | ||
handlerDialer := NewProxyDialer(endpoint.NetAddr(), endpoint.TLSName, caPool, auth, args.hideSNI, dialer) | ||
requestDialer := NewPlaintextDialer(endpoint.NetAddr(), endpoint.TLSName, caPool, args.hideSNI, dialer) | ||
mainLogger.Info("Endpoint: %s", endpoint.URL().String()) | ||
mainLogger.Info("Starting proxy server...") | ||
handler := NewProxyHandler(handlerDialer, requestDialer, auth, resolver, proxyLogger) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters