mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-03 07:56:42 -05:00
feat: Replace default Health Ping URL to HTTPS (#1991)
This commit is contained in:
parent
0cf7ac64da
commit
5bc04f3269
@ -77,7 +77,7 @@ type HealthPingConfig struct {
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// destination url, need 204 for success return
|
||||
// default http://www.google.com/gen_204
|
||||
// default https://connectivitycheck.gstatic.com/generate_204
|
||||
Destination string `protobuf:"bytes,1,opt,name=destination,proto3" json:"destination,omitempty"`
|
||||
// connectivity check url
|
||||
Connectivity string `protobuf:"bytes,2,opt,name=connectivity,proto3" json:"connectivity,omitempty"`
|
||||
|
@ -21,7 +21,7 @@ message Config {
|
||||
|
||||
message HealthPingConfig {
|
||||
// destination url, need 204 for success return
|
||||
// default http://www.google.com/gen_204
|
||||
// default https://connectivitycheck.gstatic.com/generate_204
|
||||
string destination = 1;
|
||||
// connectivity check url
|
||||
string connectivity = 2;
|
||||
@ -31,4 +31,4 @@ message HealthPingConfig {
|
||||
int32 samplingCount = 4;
|
||||
// ping timeout, int64 values of time.Duration
|
||||
int64 timeout = 5;
|
||||
}
|
||||
}
|
||||
|
@ -43,7 +43,10 @@ func NewHealthPing(ctx context.Context, config *HealthPingConfig) *HealthPing {
|
||||
}
|
||||
}
|
||||
if settings.Destination == "" {
|
||||
settings.Destination = "http://www.google.com/gen_204"
|
||||
// Destination URL, need 204 for success return default to chromium
|
||||
// https://github.com/chromium/chromium/blob/main/components/safety_check/url_constants.cc#L10
|
||||
// https://chromium.googlesource.com/chromium/src/+/refs/heads/main/components/safety_check/url_constants.cc#10
|
||||
settings.Destination = "https://connectivitycheck.gstatic.com/generate_204"
|
||||
}
|
||||
if settings.Interval == 0 {
|
||||
settings.Interval = time.Duration(1) * time.Minute
|
||||
|
Loading…
Reference in New Issue
Block a user