diff options
author | Shelikhoo <xiaokangwang@outlook.com> | 2022-03-15 12:27:29 +0000 |
---|---|---|
committer | Shelikhoo <xiaokangwang@outlook.com> | 2022-03-16 09:13:30 +0000 |
commit | 6e29dc676c44ea1b6fe5f13aec48aae91ff1cc3c (patch) | |
tree | 572c54eec8de73dad7947bc1bb67028bf7c26ff5 | |
parent | ab9604476ee7673cf35a3aea33e225946a1426e0 (diff) | |
download | snowflake-6e29dc676c44ea1b6fe5f13aec48aae91ff1cc3c.tar.gz snowflake-6e29dc676c44ea1b6fe5f13aec48aae91ff1cc3c.zip |
Add document for NewUTLSHTTPRoundTripper
-rw-r--r-- | common/utls/roundtripper.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/common/utls/roundtripper.go b/common/utls/roundtripper.go index df31ff4..53b997f 100644 --- a/common/utls/roundtripper.go +++ b/common/utls/roundtripper.go @@ -13,6 +13,14 @@ import ( "golang.org/x/net/http2" ) +// NewUTLSHTTPRoundTripper creates an instance of RoundTripper that dial to remote HTTPS endpoint with +// an alternative version of TLS implementation that attempts to imitate browsers' fingerprint. +// clientHelloID is the clientHello that uTLS attempts to imitate +// uTlsConfig is the TLS Configuration template +// backdropTransport is the transport that will be used for non-https traffic +// removeSNI indicates not to send Server Name Indication Extension +// returns a RoundTripper: its behaviour is documented at +// https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/merge_requests/76#note_2777161 func NewUTLSHTTPRoundTripper(clientHelloID utls.ClientHelloID, uTlsConfig *utls.Config, backdropTransport http.RoundTripper, removeSNI bool) http.RoundTripper { rtImpl := &uTLSHTTPRoundTripperImpl{ |