linux命令行测试是否可以访问google、github、huggingface

目录

1 google

命令行输入,

bash 复制代码
curl -s -o /dev/null -w "%{http_code}" --connect-timeout 5 https://www.google.com

返回,

bash 复制代码
200

表明可以访问!

直接curl也是可以的,

bash 复制代码
curl https://www.google.com

返回,

txt 复制代码
<!doctype html><html itemscope="" itemtype="http://schema.org/WebPage" lang="en-GB"><head><meta content="text/html; charset=UTF-8" http-equiv="Content-Type"><meta content="/images/branding/googleg/1x/googleg_standard_color_128dp.png" itemprop="image"><title>Google</title><script nonce="AvgaJhE-tkXXxO8cj8vsMw">(function(){var _g={kEI:'X4qqabmfEo7w7M8PiszayA4',kEXPI:'0,203065,1101138,2935842,48791,36419,9708,344796,5520337,36824031,25228681,152382,11943,53223,39773,74608,708,23259,37801,28334,64547,8487,6280,7714,33385,4719,21511,2117,746,1,22727,9881,36457,10795,2,2,5,21758,16179,2646,4531,14209,1167,4339,14505,1383,3,1510,5,578,2777,197,5813,2,4205,2,1792,2,1419,7727,5159,2,875,2230,5089,19,3008,19,776,9471,5157,11018,2,1,6719,4255,5337,845,2046,2,13,1560,3,5941,1011,1746,4,15193,4,2243,105,9,423,5,1113,389,4,2647,5,2498,200,1270,9,4,12,9,4,60,9,4,1489,298,3414,5839,1275,7,1784,7,1043,2,12375,2,5724,9,602,59,1590,4,2574,3336,3999,1,2,1361,41,3,1359,2,4992,10,204,441,158,2,1645,191,4,1928,4,1634,544,4,1568,1033,1399,187,2105,5,259,5,197,2366,19,1421,119,4,2364,356,1,146,1860,5,2609,4,2793,1052,4,353,1697,371,5,974,4,966,5,1125,3,2,46,769,701,1733,461,40,4,32,4,273,571,1859,4,40,4,2110,4,134,304,323,1,575,1777,672,1234,1190,4,14,3,450,4,730,5,75,4,281,1659,4,465,966,991,572,1,1092,265,7395,13,179,329,823,1454,1015,5,9,14,55,260,695,824,1428,4,281,264,563,254,2661,7,4,2,47,848,2206,5,1722,1415,1324,1758,414,4,939,22,4,184,279,152,1,791,21007087,5,2992,4,2434,526,3,8491,2,1558,3,11875,4193,3,746,6,1149,3,1452,4126,4,1969,2,693,2,6500667,2,1634,1081,3623646,210217,17,798776,11694934,4360997,112,590,5,1242,3,1448,881,113,3,30,583,4,65,388,2,707,289,4,167,4,550,219,3,2,2,2,550,4,2628,5,3371,1,875,118,1,3,4,44,2,13,16,361,1343,1,2,665,207,7,298,3,30,333,821,417,365,3046,1038,282,5,1992,206,5,131,161,5,142,4,228,2483,214,335,14,345,3,117,170,162,8,588,489,582,4,68,557,34,1,2,1857,109,556,1260,5,2,721,4,225,7,1,3,6,25,915,327,77,229,2,3,390,4,70,213,321,71,210,126,4,5,1,3,2,2,2,2,2,2,2,1,2,2,2,3,2,1,2,3,1,3,2,2,2,1,3,2,2,1,3,2,2,2,1,2,3,2,1,3,1,2,3,1,2,2,2,10,2,3,2,2,1,10,3,1,2,3,2,9,2,2,2,2,2,11,1,2,2,3,1,2,2,2,3,1,2,2,3,2,2,2,1,3,1,2,2,2,3,1,3,2,2,2,2,2,1,3,1,3,1,3,1,3,1,3,2,2,2,2,1,10,2,3,2,1,2,10,3,2,1,2,2,10,3,1,3,2,1,277,60,319,931,8,415,153,4,116,270,76,243,2,131,24,663,268,99,3,763,8,423,800,4,1202,3,872,4,335,247,2,2832,2343,9,946,142,3,601,3,2,2,2,720,189,3,9,2,2163,391,451,1899,147,132,335,4,454,319,57,509,409,357,98,188,1,2,87,5,21,203,292,3,2,2,2,239,4,238,353,3,180,1,442,28,830,187,93,71,560,1372,9,7,1,3,545,366,4,751,586,4,89,165,421,836,107,387,263,4,140,3,9,2,558,172,697,283,694,88,2,1069,2675,703,174',kBL:'FWkv',kOPI:89978449};(function(){var a;((a=window.google)==null?0:a.stvsc)?google.kEI=_g.kEI:window.google=_g;}).call(this);})();(function(){google.sn='webhp';google.kHL='en-GB';google.rdn=true;})();(function(){
var g=this||self;function k(){return window.google&&window.google.kOPI||null};var l,m=[];function n(a){for(var b;a&&(!a.getAttribute||!(b=a.getAttribute("eid")));)a=a.parentNode;return b||l}function p(a){for(var b=null;a&&(!a.getAttribute||!(b=a.getAttribute("leid")));)a=a.parentNode;return b}function q(a){/^http:/i.test(a)&&window.location.protocol==="https:"&&(google.ml&&google.ml(Error("a"),!1,{src:a,glmm:1}),a="");return a}
function r(a,b,d,c,h){var e="";b.search("&ei=")===-1&&(e="&ei="+n(c),b.search("&lei=")===-1&&(c=p(c))&&(e+="&lei="+c));var f=b.search("&cshid=")===-1&&a!=="slh";c="&zx="+Date.now().toString();g._cshid&&f&&(c+="&cshid="+g._cshid);(d=d())&&(c+="&opi="+d);return"/"+(h||"gen_204")+"?atyp=i&ct="+String(a)+"&cad="+(b+e+c)};l=google.kEI;google.getEI=n;google.getLEI=p;google.ml=function(){return null};google.log=function(a,b,d,c,h,e){e=e===void 0?k:e;d||(d=r(a,b,e,c,h));if(d=q(d)){a=new Image;var f=m.length;m[f]=a;a.onerror=a.onload=a.onabort=function(){delete m[f]};a.src=d}};google.logUrl=function(a,b){b=b===void 0?k:b;return r("",a,b)};}).call(this);(function(){google.y={};google.sy={};function e(a,b,d){if(a)var c=a.id;else{do c=Math.random();while(d[c])}d[c]=[a,b]}var f;(f=google).x||(f.x=function(a,b){e(a,b,google.y)});var g;(g=google).sx||(g.sx=function(a,b){e(a,b,google.sy)});google.bx=!1;var h;(h=google).lx||(h.lx=function(){});var k=[],l;(l=google).fce||(l.fce=function(a,b,d,c){k.push([a,b,d,c])});google.qce=k;google.adl=[];}).call(this);google.f={};(function(){
document.documentElement.addEventListener("submit",function(b){var a;if(a=b.target){var c=a.getAttribute("data-submitfalse");a=c==="1"||c==="q"&&!a.elements.q.value?!0:!1}else a=!1;a&&(b.preventDefault(),b.stopPropagation())},!0);document.documentElement.addEventListener("click",function(b){var a;a:{for(a=b.target;a&&a!==document.documentElement;a=a.parentElement)if(a.tagName==="A"){a=a.getAttribute("data-nohref")==="1";break a}a=!1}a&&b.preventDefault()},!0);}).call(this);</script><style>#gbar,#guser{font-size:13px;padding-top:1px !important;}#gbar{height:22px}#guser{padding-bottom:7px !important;text-align:right}.gbh,.gbd{border-top:1px solid #c9d7f1;font-size:1px}.gbh{height:0;position:absolute;top:24px;width:100%}@media all{.gb1{height:22px;margin-right:.5em;vertical-align:top}#gbar{float:left}}a.gb1,a.gb4{text-decoration:underline !important}a.gb1,a.gb4{color:#00c !important}.gbi .gb4{color:#dd8e27 !important}.gbf .gb4{color:#900 !important}
</style><style>body,td,a,p,.h{font-family:sans-serif}body{margin:0;overflow-y:scroll}#gog{padding:3px 8px 0}td{line-height:.8em}.gac_m td{line-height:17px}form{margin-bottom:20px}.h{color:#1967d2}em{font-weight:bold;font-style:normal}.lst{height:25px;width:496px}.gsfi,.lst{font:18px sans-serif}.gsfs{font:17px sans-serif}.ds{display:inline-box;display:inline-block;margin:3px 0 4px;margin-left:4px}input{font-family:inherit}body{background:#fff;color:#1f1f1f}a{color:#681da8;text-decoration:none}a:hover,a:active{text-decoration:underline}.fl a{color:#1967d2}a:visited{color:#681da8}.sblc{padding-top:5px}.sblc a{display:block;margin:2px 0;margin-left:13px;font-size:11px}.lsbb{background:#ecedee;border:solid 1px;border-color:#d2d2d2 #70757a #70757a #d2d2d2;height:30px}.lsbb{display:block}#WqQANb a{display:inline-block;margin:0 12px}.lsb{background:url(/images/nav_logo229.png) 0 -261px repeat-x;color:#1f1f1f;border:none;cursor:pointer;height:30px;margin:0;outline:0;font:15px sans-serif;vertical-align:top}.lsb:active{background:#dadce0}.lst:focus{outline:none}</style><script nonce="AvgaJhE-tkXXxO8cj8vsMw">(function(){window.google.erd={jsr:1,bv:2391,de:true,dpf:'5BHYWz1aaMZRO0wHSm4Ijm48JmuwjE1d2PMVecEtGjM',c:'2d3f'};
var f=this||self;var k,l=(k=f.mei)!=null?k:1,m,p=(m=f.diel)!=null?m:0,q,r=(q=f.sdo)!=null?q:!0,t=0,u,v=google.erd,w=v.jsr;google.ml=function(a,b,d,n,e){e=e===void 0?2:e;b&&(u=a&&a.message);d===void 0&&(d={});d.cad="ple_"+google.ple+".aple_"+google.aple;if(google.dl)return google.dl(a,e,d,!0),null;b=d;if(w<0){window.console&&console.error(a,b);if(w===-2)throw a;b=!1}else b=!a||!a.message||a.message==="Error loading script"||t>=l&&!n?!1:!0;if(!b)return null;t++;d=d||{};b=encodeURIComponent;var c="/gen_204?atyp=i&ei="+b(google.kEI);google.kEXPI&&(c+="&jexpid="+b(google.kEXPI));c+="&srcpg="+b(google.sn)+"&jsr="+b(v.jsr)+
"&bver="+b(v.bv);v.dpf&&(c+="&dpf="+b(v.dpf));var g=a.lineNumber;g!==void 0&&(c+="&line="+g);var h=a.fileName;h&&(h.indexOf("-extension:/")>0&&(e=3),c+="&script="+b(h),g&&h===window.location.href&&(g=document.documentElement.outerHTML.split("\n")[g],c+="&cad="+b(g?g.substring(0,300):"No script found.")));google.ple&&google.ple===1&&(e=2);d&&v.c&&(d.ofc=String(v.c));c=c+("&jsel="+e)+"&ectx="+b(JSON.stringify(d));c+="&emsg=";c+=b(a.name+": "+a.message);c+="&jsst=";c+=b(a.stack||"N/A");c.length>=12288&&
(c=c.substring(0,12288));a=c;n||google.log(0,"",a);return a};window.onerror=function(a,b,d,n,e){u!==a&&(a=e instanceof Error?e:Error(a),d===void 0||"lineNumber"in a||(a.lineNumber=d),b===void 0||"fileName"in a||(a.fileName=b),google.ml(a,!1,void 0,!1,a.name==="SyntaxError"||a.message.substring(0,11)==="SyntaxError"||a.message.indexOf("Script error")!==-1?3:p));u=null;r&&t>=l&&(window.onerror=null)};})();</script></head><body bgcolor="#fff"><script nonce="AvgaJhE-tkXXxO8cj8vsMw">(function(){var src='/images/nav_logo229.png';var iesg=false;document.body.onload = function(){window.n && window.n();if (document.images){new Image().src=src;}
if (!iesg){document.f&&document.f.q.focus();document.gbqf&&document.gbqf.q.focus();}
}
})();</script><div id="mngb"><div id=gbar><nobr><b class=gb1>Search</b> <a class=gb1 href="https://www.google.com/imghp?hl=en&tab=wi">Images</a> <a class=gb1 href="https://maps.google.co.uk/maps?hl=en&tab=wl">Maps</a> <a class=gb1 href="https://play.google.com/?hl=en&tab=w8">Play</a> <a class=gb1 href="https://www.youtube.com/?tab=w1">YouTube</a> <a class=gb1 href="https://news.google.com/?tab=wn">News</a> <a class=gb1 href="https://mail.google.com/mail/?tab=wm">Gmail</a> <a class=gb1 href="https://drive.google.com/?tab=wo">Drive</a> <a class=gb1 style="text-decoration:none" href="https://www.google.co.uk/intl/en/about/products?tab=wh"><u>More</u> >></a></nobr></div><div id=guser width=100%><nobr><span id=gbn class=gbi></span><span id=gbf class=gbf></span><span id=gbe></span><a href="http://www.google.co.uk/history/optout?hl=en" class=gb4>Web History</a> | <a  href="/preferences?hl=en" class=gb4>Settings</a> | <a target=_top id=gb_70 href="https://accounts.google.com/ServiceLogin?hl=en&passive=true&continue=https://www.google.com/&ec=GAZAAQ" class=gb4>Sign in</a></nobr></div><div class=gbh style=left:0></div><div class=gbh style=right:0></div></div><center><br clear="all" id="lgpd"><div><img alt="Google" height="92" src="/images/branding/googlelogo/1x/googlelogo_white_background_color_272x92dp.png" style="padding:28px 0 14px" width="272" id="hplogo"><br><br></div><form action="/search" name="f"><table cellpadding="0" cellspacing="0"><tr valign="top"><td width="25%">&nbsp;</td><td align="center" nowrap=""><input name="ie" value="ISO-8859-1" type="hidden"><input value="en-GB" name="hl" type="hidden"><input name="source" type="hidden" value="hp"><input name="biw" type="hidden"><input name="bih" type="hidden"><div class="ds" style="height:32px;margin:4px 0"><input class="lst" style="margin:0;padding:5px 8px 0 6px;vertical-align:top;color:#1f1f1f" autocomplete="off" value="" title="Google Search" maxlength="2048" name="q" size="57"></div><br style="line-height:0"><span class="ds"><span class="lsbb"><input class="lsb" value="Google Search" name="btnG" type="submit"></span></span><span class="ds"><span class="lsbb"><input class="lsb" id="tsuid_X4qqabmfEo7w7M8PiszayA4_1" value="I'm Feeling Lucky" name="btnI" type="submit"><script nonce="AvgaJhE-tkXXxO8cj8vsMw">(function(){var id='tsuid_X4qqabmfEo7w7M8PiszayA4_1';document.getElementById(id).onclick = function(){if (this.form.q.value){this.checked = 1;if (this.form.iflsig)this.form.iflsig.disabled = false;}
else top.location='/doodles/';};})();</script><input value="AFdpzrgAAAAAaaqYb6IiYbteqH8ZpxbeDj2SWPS2NmV_" name="iflsig" type="hidden"></span></span></td><td class="fl sblc" align="left" nowrap="" width="25%"><a href="/advanced_search?hl=en-GB&amp;authuser=0">Advanced search</a></td></tr></table><input id="gbv" name="gbv" type="hidden" value="1"><script nonce="AvgaJhE-tkXXxO8cj8vsMw">(function(){var a,b="1";if(document&&document.getElementById)if(typeof XMLHttpRequest!="undefined")b="2";else if(typeof ActiveXObject!="undefined"){var c,d,e=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];for(c=0;d=e[c++];)try{new ActiveXObject(d),b="2"}catch(h){}}a=b;if(a=="2"&&location.search.indexOf("&gbv=2")==-1){var f=google.gbvu,g=document.getElementById("gbv");g&&(g.value=a);f&&window.setTimeout(function(){location.href=f},0)};}).call(this);</script></form><div style="font-size:83%;min-height:3.5em"><br></div><span id="footer"><div style="font-size:10pt"><div style="margin:19px auto;text-align:center" id="WqQANb"><a href="/intl/en/ads/">Advertising</a><a href="/services/">Business Solutions</a><a href="/intl/en/about.html">About Google</a><a href="https://www.google.com/setprefdomain?prefdom=GB&amp;prev=https://www.google.co.uk/&amp;sig=K_2V_Q4rhgjIcYumj20QHWr2mehxU%3D">Google.co.uk</a></div></div><p style="font-size:8pt;color:#636363">&copy; 2026 - <a href="/intl/en/policies/privacy/">Privacy</a> - <a href="/intl/en/policies/terms/">Terms</a></p></span></center><script nonce="AvgaJhE-tkXXxO8cj8vsMw">(function(){window.google.cdo={height:757,width:1440};(function(){var a=window.innerWidth,b=window.innerHeight;if(!a||!b){var c=window.document,d=c.compatMode=="CSS1Compat"?c.documentElement:c.body;a=d.clientWidth;b=d.clientHeight}if(a&&b&&(a!=google.cdo.width||b!=google.cdo.height)){var e=google,f=e.log,g="/client_204?&atyp=i&biw="+a+"&bih="+b+"&ei="+google.kEI,h="",k=window.google&&window.google.kOPI||null;k&&(h+="&opi="+k);f.call(e,"","",g+h)};}).call(this);})();(function(){google.xjs={basecomb:'/xjs/_/js/k\x3dxjs.hp.en.6nHg06YsiTs.es5.O/ck\x3dxjs.hp.e6INf-r8c5o.L.X.O/am\x3dAAIAAAAAAACAAAAAAAAAAAAAAAAAAAAAgAAAAABAgEAAAAAAAAAAAAAAAIAAAAAAAAAABAMAACAAhAAAAAAAAAIAQAAAAAAABAAACAABAAAA4o4AAAAAAAACYBEAAAAAAADAQw/d\x3d1/ed\x3d1/dg\x3d0/ujg\x3d1/rs\x3dACT90oFznQxkyFP2aMfTE4BreLPVgMt6LA',basecss:'/xjs/_/ss/k\x3dxjs.hp.e6INf-r8c5o.L.X.O/am\x3dAAIAAAAAAACAAAAAAAAAAAAAAAAAAAAAgAAAAABAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAhAAAAAAAAAIAQAAAAAAABAAACAAB/rs\x3dACT90oE3hE8GJuI227gVvcps4mR5O87OoA',basejs:'/xjs/_/js/k\x3dxjs.hp.en.6nHg06YsiTs.es5.O/am\x3dAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAIAAAAAAAAAABAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4o4AAAAAAAACYBEAAAAAAADAQw/dg\x3d0/rs\x3dACT90oGpQY_oz3AX_dwHWBh0RLWf0yxrvQ',excm:[]};})();(function(){var u='/xjs/_/js/k\x3dxjs.hp.en.6nHg06YsiTs.es5.O/am\x3dAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAIAAAAAAAAAABAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4o4AAAAAAAACYBEAAAAAAADAQw/d\x3d1/ed\x3d1/dg\x3d4/rs\x3dACT90oGpQY_oz3AX_dwHWBh0RLWf0yxrvQ/m\x3dsb_he,d';var st=1;var amd=1000;var mmd=0;var pop=true;var povp=false;var raf=false;var lfpp=false;var ecb=false;var cst=false;var pxp=false;
var f=this||self;function g(){var a=google.ia&&google.ia.r.B2Jtyd;return a&&[1,5,6].indexOf(a.m)>=0&&a.cbfd&&a.cbvi?a:void 0};function h(a){var b=document.createElement("link");b.as="script";b.href=a;b.rel="preload";document.body.appendChild(b)}function k(){var a=[l];google.dp||(a.forEach(h),google.dp=!0)};google.ps=google.ps||[];function m(a){return a?(a=a.match(/[/?&]ccb=([^/&?#]+)/))?a[1]:null:null}function p(a){var b=l,c=function(){};google.lx=google.stvsc?c:function(){q(b,a&&raf,a&&lfpp);google.lx=c};google.bx||google.lx()}function r(a,b){b&&(a.src=b);if(!m(a.src)){var c=a.onload;a.onload=function(d){c&&c(d);google.ps=google.ps.filter(function(e){return a.src!==e})}}google.ps.push(a.src);document.body.appendChild(a)}
function t(a,b,c,d){c&&(a.fetchPriority="low");b?requestAnimationFrame(function(){r(a,d)}):r(a,d)}google.as=r;function q(a,b,c){google.tick&&google.tick("load","xjsls");var d=document.createElement("script");d.onerror=function(){google.ple=1};d.onload=function(){google.ple=0};google.xjsus=void 0;t(d,b,c,a);google.aple=-1;google.dp=!0};function w(){for(var a=document.getElementsByTagName("img"),b=0,c=a.length;b<c;b++){var d=a[b],e;if(e=d.hasAttribute("data-lzy_")&&Number(d.getAttribute("data-atf"))&1)e=d.getAttribute("jscontroller"),e=!((e==="UBXHI"||e==="R3fhkb"||e==="TSZEqd")&&d.hasAttribute("data-src"));if(e)return!0}return!1};var l,x,y,z,A,B,C,D,E,F,G="";function H(){l=pxp&&google.xjsup||u;var a=l.match(/\/cb=(loaded_h_\d+)/);a&&a[1]&&(G=a[1]);google.xjsu=l;f._F_jsUrl=l;B=function(c){p(c)};x=!1;y=(st===1||st===3)&&!!google.caft&&!w();z=g();A=!G&&(st===2||st===3)&&!!z&&!w();if(G){var b=(st===2||st===3)&&!!z;f[G]=function(c){var d=!1,e=function(){d||(d=!0,cst?setTimeout(function(){return void c.call(window,window._)},0):c.call(window,window._))};b&&google.ia.adls?(z.cbvi.push(function(){delete google.ia.adls}),z.cbvi.push(e),setTimeout(e,mmd)):e()}}C=
pop;D=povp;E=C&&document.prerendering||D&&document.hidden;F=D?"visibilitychange":"prerenderingchange"}function I(a){x||y||A||E||(B(a),x=!0)}
setTimeout(function(){google.tick&&google.tick("load","xjspls");H();if(y||A||E){if(y){var a=function(){y=!1;I()};google.caft(a);setTimeout(a,amd)}A&&(a=function(){A=!1;I()},z.cbvi.push(a),setTimeout(a,mmd));if(E){var b=function(){(D?document.hidden:document.prerendering)||(E=!1,I(!D),document.removeEventListener(F,b))};document.addEventListener(F,b,{passive:!0})}x||k()}else B()},0);})();window._ = window._ || {};window._DumpException = _._DumpException = function(e){throw e;};window._s = window._s || {};_s._DumpException = _._DumpException;window._qs = window._qs || {};_qs._DumpException = _._DumpException;window.loaded_h_0 = function(cb){cb.call(window,window._);};(function(){var t=[512,0,2048,0,0,0,524288,268697600,24768,4,65536,69206016,33108032,739246082,33555586,8448,4328470,16777224,0,256,65544,998768640,8,8388608,4450,0,277504];window._F_toggles = window._xjs_toggles = t;})();window._F_installCss = window._F_installCss || function(css){};(function(){var pmc='{\x22d\x22:{},\x22sb_he\x22:{\x22client\x22:\x22heirloom-hp\x22,\x22dh\x22:true,\x22ds\x22:\x22\x22,\x22host\x22:\x22google.com\x22,\x22jsonp\x22:true,\x22msgs\x22:{\x22cibl\x22:\x22Clear Search\x22,\x22dym\x22:\x22Did you mean:\x22,\x22lcky\x22:\x22I\\u0026#39;m Feeling Lucky\x22,\x22lml\x22:\x22Learn more\x22,\x22psrc\x22:\x22This search was removed from your \\u003Ca href\x3d\\\x22/history\\\x22\\u003EWeb History\\u003C/a\\u003E\x22,\x22psrl\x22:\x22Remove\x22,\x22sbit\x22:\x22Search by image\x22,\x22srch\x22:\x22Google Search\x22},\x22ovr\x22:{},\x22pq\x22:\x22\x22,\x22rfs\x22:[],\x22stok\x22:\x22HwWFZ3-E7UJKwieG3EjqLIddZzc\x22}}';google.pmc=JSON.parse(pmc);})();</script></body></html>

2 github

命令行输入,

bash 复制代码
curl -s -o /dev/null -w "%{http_code}" --connect-timeout 5 https://github.com

返回,

bash 复制代码
200

表明可以访问!

3 huggingface

命令行输入,

bash 复制代码
curl -s -o /dev/null -w "%{http_code}" --connect-timeout 5 https://huggingface.co

返回,

bash 复制代码
200

表明可以访问!

问题:为什么不用ping进行测试呢?

主要有以下几个原因:

  • 很多服务器禁用了 ICMPping 协议):不少网站(包括某些 CDN 节点)会在防火墙层面丢弃 ICMP 包,导致 ping 不通,但实际上通过 HTTP/HTTPS 访问是完全正常的。这会产生误判。
  • curl 测试的是真实的访问场景:我们真正关心的是"能不能通过 HTTPS 访问网站",curl 直接发起 HTTP 请求,返回状态码 200 就代表整个链路(DNS 解析 → TCP 连接 → TLS 握手 → HTTP 响应)都是通的。
  • 代理环境下 ping 不走代理:如果系统配置了 HTTP 代理,curl 会遵循代理设置,而 ping 使用 ICMP 协议,不经过代理,可能导致结果不一致。
相关推荐
U盘失踪了2 小时前
VMware® Workstation 17 Pro 解决VMware Tools 安装
linux·运维·服务器
中科三方2 小时前
DNS解析负载均衡:实现原理、核心策略与权威实践
运维·负载均衡
WangJunXiang62 小时前
系统安全及应用
安全·github·系统安全
zhensherlock2 小时前
Protocol Launcher 系列:一键唤起 VSCodium 智能 IDE
javascript·ide·vscode·typescript·开源·编辑器·github
未来之窗软件服务2 小时前
服务器运维(四十四)Python Gradio服务器伪请求pseudo http —东方仙盟
运维·服务器·http·仙盟创梦ide·东方仙盟
ego.iblacat2 小时前
Linux 系统安全及应用
linux·运维·系统安全
十年编程老舅2 小时前
C++ 原子操作实战:实现无锁数据结构
linux·c++·c++11·原子操作·无锁队列
卢傢蕊2 小时前
Linux系统安全
linux·运维·系统安全
东北甜妹2 小时前
LVS故障排查
运维