curl-ihttp://ip.cn 301永久搬迁
我读了一篇文章,其中提到了一种网络测试方法 预期结果: 实际结果: 更新: 谢谢你的回答,它很有效 这是符合预期的测试结果curl-ihttp://ip.cn 301永久搬迁,curl,networking,proxy,network-programming,http-proxy,Curl,Networking,Proxy,Network Programming,Http Proxy,我读了一篇文章,其中提到了一种网络测试方法 预期结果: 实际结果: 更新: 谢谢你的回答,它很有效 这是符合预期的测试结果 ➜ work git:(master) ✗ curl -i https://ip.cn HTTP/2 200 date: Tue, 18 Feb 2020 10:12:29 GMT content-type: application/json; charset=UTF-8 set-cookie: __cfduid=de415094860b360bfae3d59038042
➜ work git:(master) ✗ curl -i https://ip.cn
HTTP/2 200
date: Tue, 18 Feb 2020 10:12:29 GMT
content-type: application/json; charset=UTF-8
set-cookie: __cfduid=de415094860b360bfae3d5903804244451582020749; expires=Thu, 19-Mar-20 10:12:29 GMT; path=/; domain=.ip.cn; HttpOnly; SameSite=Lax
cf-cache-status: DYNAMIC
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
alt-svc: h3-25=":443"; ma=86400, h3-24=":443"; ma=86400, h3-23=":443"; ma=86400
server: cloudflare
cf-ray: 566f39135e2feb61-LAX
{"ip": "124.64.19.119", "country": "北京市", "city": "联通”}
➜ work git:(master) ✗ export ALL_PROXY=socks5://127.0.0.1:1086
➜ work git:(master) ✗ curl -i https://ip.cn
HTTP/2 200
date: Tue, 18 Feb 2020 10:13:34 GMT
content-type: application/json; charset=UTF-8
set-cookie: __cfduid=d59e4719e6efbfddb9fd408db5c8d415f1582020814; expires=Thu, 19-Mar-20 10:13:34 GMT; path=/; domain=.ip.cn; HttpOnly; SameSite=Lax
cf-cache-status: DYNAMIC
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
alt-svc: h3-25=":443"; ma=86400, h3-24=":443"; ma=86400, h3-23=":443"; ma=86400
server: cloudflare
cf-ray: 566f3aa8bdc9d942-HKG
{"ip": "112.119.149.55", "country": "香港特别行政区", "city": "电讯盈科"}
后续问题:
但它仍然无法下载android项目的依赖项
gongzelong:android gongzelong$ ./gradlew build
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not resolve com.google.gms:google-services:4.3.3.
Required by:
project :
> Could not resolve com.google.gms:google-services:4.3.3.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.3.3/google-services-4.3.3.pom'.
> Could not HEAD 'https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.3.3/google-services-4.3.3.pom'.
> Read timed out
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 30s
它希望您使用HTTPS版本,以便发回重定向响应。将-L添加到命令行或在URL中使用https:// 它希望您使用HTTPS版本。将-L添加到命令行或在URL中使用https…@DanielStenberg谢谢,它可以工作。你能解释一下-L吗?我查看了curl-help,它的意思是-L,-位置跟随重定向。有-L和没有-L有什么区别?@DanielStenberg和我强烈建议你把它写下来作为一个答案,这样,我可以批准你表达我的感谢。它很有效:D谢谢。但它仍然得到错误,无法获取资源的https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.3.3/google-services-4.3.3.pom'. 在终端中,当I./gradlew构建时。你知道如何调试它吗?
gongzelong:android gongzelong$ ./gradlew build
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not resolve com.google.gms:google-services:4.3.3.
Required by:
project :
> Could not resolve com.google.gms:google-services:4.3.3.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.3.3/google-services-4.3.3.pom'.
> Could not HEAD 'https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.3.3/google-services-4.3.3.pom'.
> Read timed out
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 30s