mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Add uTLS remove SNI to snowflake client
This commit is contained in:
parent
9af0ad119b
commit
ccfdcab8fe
3 changed files with 8 additions and 3 deletions
|
@ -56,13 +56,13 @@ func createBrokerTransport() http.RoundTripper {
|
|||
}
|
||||
|
||||
func NewBrokerChannel(broker, ampCache, front string, keepLocalAddresses bool) (*BrokerChannel, error) {
|
||||
return NewBrokerChannelWithUTlsClientID(broker, ampCache, front, keepLocalAddresses, "")
|
||||
return NewBrokerChannelWithUTlsClientID(broker, ampCache, front, keepLocalAddresses, "", false)
|
||||
}
|
||||
|
||||
// NewBrokerChannelWithUTlsClientID construct a new BrokerChannel, where:
|
||||
// |broker| is the full URL of the facilitating program which assigns proxies
|
||||
// to clients, and |front| is the option fronting domain.
|
||||
func NewBrokerChannelWithUTlsClientID(broker, ampCache, front string, keepLocalAddresses bool, utlsClientID string) (*BrokerChannel, error) {
|
||||
func NewBrokerChannelWithUTlsClientID(broker, ampCache, front string, keepLocalAddresses bool, utlsClientID string, removeSNI bool) (*BrokerChannel, error) {
|
||||
log.Println("Rendezvous using Broker at:", broker)
|
||||
if ampCache != "" {
|
||||
log.Println("Through AMP cache at:", ampCache)
|
||||
|
@ -79,7 +79,7 @@ func NewBrokerChannelWithUTlsClientID(broker, ampCache, front string, keepLocalA
|
|||
return nil, fmt.Errorf("unable to create broker channel: %v", err)
|
||||
}
|
||||
config := &utls.Config{}
|
||||
brokerTransport = utlsutil.NewUTLSHTTPRoundTripper(utlsClientHelloID, config, brokerTransport, false)
|
||||
brokerTransport = utlsutil.NewUTLSHTTPRoundTripper(utlsClientHelloID, config, brokerTransport, removeSNI)
|
||||
}
|
||||
|
||||
var rendezvous RendezvousMethod
|
||||
|
|
|
@ -100,6 +100,9 @@ type ClientConfig struct {
|
|||
// UTlsClientID is the type of user application that snowflake should imitate.
|
||||
// If an empty value is provided, it will use Go's default TLS implementation
|
||||
UTlsClientID string
|
||||
// UTlsRemoveSNI is the flag to control whether SNI should be removed from Client Hello
|
||||
// when uTLS is used.
|
||||
UTlsRemoveSNI bool
|
||||
}
|
||||
|
||||
// NewSnowflakeClient creates a new Snowflake transport client that can spawn multiple
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue