File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -137,6 +137,12 @@ techniques).**
137137` ServerName ` is the domain you want to make your ISP or firewall _ think_ you are visiting. Ideally it should
138138match ` RedirAddr ` in the server's configuration, a major site the censor allows, but it doesn't have to.
139139
140+ ` CDNOriginHost ` is the domain name of the _ origin_ server (i.e. the server running Cloak) under ` CDN ` mode. This only
141+ has effect when ` Transport ` is set to ` CDN ` . If unset, it will default to the remote hostname supplied via the
142+ commandline argument (in standalone mode), or by Shadowsocks (in plugin mode). After a TLS session is established with
143+ the CDN server, this domain name will be used in the HTTP request to ask the CDN server to establish a WebSocket
144+ connection with this host.
145+
140146` NumConn ` is the amount of underlying TCP connections you want to use. The default of 4 should be appropriate for most
141147people. Setting it too high will hinder the performance. Setting it to 0 will disable connection multiplexing and each
142148TCP connection will spawn a separate short-lived session that will be closed after it is terminated. This makes it
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ type RawConfig struct {
3535 UDP bool // nullable
3636 BrowserSig string // nullable
3737 Transport string // nullable
38+ CDNOriginHost string // nullable
3839 StreamTimeout int // nullable
3940 KeepAlive int // nullable
4041}
@@ -189,9 +190,16 @@ func (raw *RawConfig) ProcessRawConfig(worldState common.WorldState) (local Loca
189190 // Transport and (if TLS mode), browser
190191 switch strings .ToLower (raw .Transport ) {
191192 case "cdn" :
193+ var cdnDomainPort string
194+ if raw .CDNOriginHost == "" {
195+ cdnDomainPort = net .JoinHostPort (raw .RemoteHost , raw .RemotePort )
196+ } else {
197+ cdnDomainPort = net .JoinHostPort (raw .CDNOriginHost , raw .RemotePort )
198+ }
199+
192200 remote .TransportMaker = func () Transport {
193201 return & WSOverTLS {
194- cdnDomainPort : remote . RemoteAddr ,
202+ cdnDomainPort : cdnDomainPort ,
195203 }
196204 }
197205 case "direct" :
You can’t perform that action at this time.
0 commit comments