master
1/***************************************************************************
2 * _ _ ____ _
3 * Project ___| | | | _ \| |
4 * / __| | | | |_) | |
5 * | (__| |_| | _ <| |___
6 * \___|\___/|_| \_\_____|
7 *
8 * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
9 *
10 * This software is licensed as described in the file COPYING, which
11 * you should have received as part of this distribution. The terms
12 * are also available at https://curl.se/docs/copyright.html.
13 *
14 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 * copies of the Software, and permit persons to whom the Software is
16 * furnished to do so, under the terms of the COPYING file.
17 *
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
20 *
21 * SPDX-License-Identifier: curl
22 *
23 ***************************************************************************/
24#include "curl_setup.h"
26#ifndef CURL_DISABLE_PROXY
28#include "urldata.h"
29#include "curl_trc.h"
30#include "protocol.h"
31#include "proxy.h"
32#include "http_proxy.h"
33#include "strcase.h"
34#include "url.h"
35#include "vauth/vauth.h"
36#include "curlx/inet_pton.h"
37#include "curlx/strparse.h"
39#ifdef HAVE_NETINET_IN_H
40#include <netinet/in.h>
41#endif
43#ifdef HAVE_ARPA_INET_H
44#include <arpa/inet.h>
45#endif
47/*
48 * cidr4_match() returns TRUE if the given IPv4 address is within the
49 * specified CIDR address range.
50 *
51 * bits is passed as -1 if not provided.
52 *
53 * @unittest 1614
54 */
55UNITTEST bool cidr4_match(const char *ipv4, /* 1.2.3.4 address */
56 const char *network, /* 1.2.3.4 address */
57 int bits);
58UNITTEST bool cidr4_match(const char *ipv4, /* 1.2.3.4 address */
59 const char *network, /* 1.2.3.4 address */
60 int bits)
61{
62 unsigned int address = 0;
63 unsigned int check = 0;
65 if(bits > 32)
66 /* strange input */
67 return FALSE;
69 if(curlx_inet_pton(AF_INET, ipv4, &address) != 1)
70 return FALSE;
71 if(curlx_inet_pton(AF_INET, network, &check) != 1)
72 return FALSE;
74 if((bits > 0) && (bits != 32)) {
75 unsigned int mask = 0xffffffff << (32 - bits);
76 unsigned int haddr = htonl(address);
77 unsigned int hcheck = htonl(check);
78#if 0
79 curl_mfprintf(stderr, "Host %s (%x) network %s (%x) "
80 "bits %u mask %x => %x\n",
81 ipv4, haddr, network, hcheck, bits, mask,
82 (haddr ^ hcheck) & mask);
83#endif
84 if((haddr ^ hcheck) & mask)
85 return FALSE;
86 return TRUE;
87 }
88 else if(!bits && !check)
89 /* 0.0.0.0/0 matches everything */
90 return TRUE;
92 return address == check;
93}
95/*
96 * cidr6_match() returns TRUE if the given IPv6 address is within the
97 * specified CIDR address range.
98 *
99 * bits is passed as -1 if not provided.
100 *
101 * @unittest 1614
102 */
103UNITTEST bool cidr6_match(const char *ipv6, const char *network,
104 int bits);
105UNITTEST bool cidr6_match(const char *ipv6, const char *network,
106 int bits)
107{
108#ifdef USE_IPV6
109 static const char null6[16]= { 0 };
110 unsigned int bytes;
111 unsigned int rest;
112 unsigned char address[16];
113 unsigned char check[16];
115 if(bits == -1)
116 bits = 128;
118 bytes = bits / 8;
119 rest = bits & 0x07;
120 if((bytes > 16) || ((bytes == 16) && rest))
121 return FALSE;
122 if(curlx_inet_pton(AF_INET6, ipv6, address) != 1)
123 return FALSE;
124 if(curlx_inet_pton(AF_INET6, network, check) != 1)
125 return FALSE;
126 if((bytes == 16) && !bits && !memcmp(null6, check, 16))
127 /* ::/0 matches everything */
128 return TRUE;
129 if(bytes && memcmp(address, check, bytes))
130 return FALSE;
131 if(rest && ((address[bytes] ^ check[bytes]) & (0xff << (8 - rest))))
132 return FALSE;
134 return TRUE;
135#else
136 (void)ipv6;
137 (void)network;
138 (void)bits;
139 return FALSE;
140#endif
141}
143enum nametype {
144 TYPE_HOST,
145 TYPE_IPV4,
146 TYPE_IPV6
147};
149static bool match_host(const char *token, size_t tokenlen,
150 const char *name, size_t namelen)
151{
152 bool match = FALSE;
154 /* ignore trailing dots in the token to check */
155 if(token[tokenlen - 1] == '.')
156 tokenlen--;
158 if(tokenlen && (*token == '.')) {
159 /* ignore leading token dot as well */
160 token++;
161 tokenlen--;
162 }
163 /* A: example.com matches 'example.com'
164 B: www.example.com matches 'example.com'
165 C: nonexample.com DOES NOT match 'example.com'
166 */
167 if(tokenlen == namelen)
168 /* case A, exact match */
169 match = curl_strnequal(token, name, namelen);
170 else if(tokenlen < namelen) {
171 /* case B, tailmatch domain */
172 match = (name[namelen - tokenlen - 1] == '.') &&
173 curl_strnequal(token, name + (namelen - tokenlen), tokenlen);
174 }
175 /* case C passes through, not a match */
176 return match;
177}
179static bool match_ip(int type, const char *token, size_t tokenlen,
180 const char *name)
181{
182 char *slash;
183 int bits = -1; /* negative means not provided */
184 char checkip[128];
185 if(tokenlen >= sizeof(checkip))
186 /* this cannot match */
187 return FALSE;
188 /* copy the check name to a temp buffer */
189 memcpy(checkip, token, tokenlen);
190 checkip[tokenlen] = 0;
192 slash = strchr(checkip, '/');
193 /* if the slash is part of this token, use it */
194 if(slash) {
195 curl_off_t value;
196 const char *p = &slash[1];
197 if(curlx_str_number(&p, &value, 128) || *p)
198 return FALSE;
199 /* a too large value is rejected in the cidr function below */
200 bits = (int)value;
201 *slash = 0; /* null-terminate there */
202 }
203 if(type == TYPE_IPV6)
204 return cidr6_match(name, checkip, bits);
205 else
206 return cidr4_match(name, checkip, bits);
207}
209/****************************************************************
210 * Checks if the host is in the noproxy list. returns TRUE if it matches and
211 * therefore the proxy should NOT be used.
212 ****************************************************************/
213/* @unittest 1614 */
214UNITTEST bool proxy_check_noproxy(const char *name, const char *no_proxy);
215UNITTEST bool proxy_check_noproxy(const char *name, const char *no_proxy)
216{
217 /*
218 * If we do not have a hostname at all, like for example with a FILE
219 * transfer, we have nothing to interrogate the noproxy list with.
220 */
221 if(!name || name[0] == '\0')
222 return FALSE;
224 /* no_proxy=domain1.dom,host.domain2.dom
225 * (a comma-separated list of hosts which should
226 * not be proxied, or an asterisk to override
227 * all proxy variables)
228 */
229 if(no_proxy && no_proxy[0]) {
230 const char *p = no_proxy;
231 size_t namelen;
232 char address[16];
233 enum nametype type = TYPE_HOST;
234 if(!strcmp("*", no_proxy))
235 return TRUE;
237 /* NO_PROXY was specified and it was not only an asterisk */
239 /* Check if name is an IP address; if not, assume it being a hostname. */
240 namelen = strlen(name);
241 if(curlx_inet_pton(AF_INET, name, &address) == 1)
242 type = TYPE_IPV4;
243#ifdef USE_IPV6
244 else if(curlx_inet_pton(AF_INET6, name, &address) == 1)
245 type = TYPE_IPV6;
246#endif
247 else {
248 /* ignore trailing dots in the hostname */
249 if(name[namelen - 1] == '.')
250 namelen--;
251 }
253 while(*p) {
254 const char *token;
255 size_t tokenlen = 0;
257 /* pass blanks */
258 curlx_str_passblanks(&p);
260 token = p;
261 /* pass over the pattern */
262 while(*p && !ISBLANK(*p) && (*p != ',')) {
263 p++;
264 tokenlen++;
265 }
267 if(tokenlen) {
268 bool match = FALSE;
269 if(type == TYPE_HOST)
270 match = match_host(token, tokenlen, name, namelen);
271 else
272 match = match_ip(type, token, tokenlen, name);
274 if(match)
275 return TRUE;
276 }
278 /* pass blanks after pattern */
279 curlx_str_passblanks(&p);
280 /* if not a comma, this ends the loop */
281 if(*p != ',')
282 break;
283 /* pass any number of commas */
284 while(*p == ',')
285 p++;
286 } /* while(*p) */
287 } /* NO_PROXY was specified and it was not only an asterisk */
289 return FALSE;
290}
292#ifndef CURL_DISABLE_HTTP
294/****************************************************************
295 * Detect what (if any) proxy to use. Remember that this selects a host
296 * name and is not limited to HTTP proxies only.
297 * The returned pointer must be freed by the caller.
298 ****************************************************************/
299static char *proxy_detect_proxy(struct Curl_easy *data,
300 const struct Curl_scheme *scheme)
301{
302 /* If proxy was not specified, we check for default proxy environment
303 * variables, to enable i.e Lynx compliance:
304 *
305 * http_proxy=http://some.server.dom:port/
306 * https_proxy=http://some.server.dom:port/
307 * ftp_proxy=http://some.server.dom:port/
308 * no_proxy=domain1.dom,host.domain2.dom
309 * (a comma-separated list of hosts which should
310 * not be proxied, or an asterisk to override
311 * all proxy variables)
312 * all_proxy=http://some.server.dom:port/
313 * (seems to exist for the CERN www lib. Probably
314 * the first to check for.)
315 *
316 * For compatibility, the all-uppercase versions of these variables are
317 * checked if the lowercase versions do not exist.
318 */
319 const char *env_name = NULL;
320 char *proxy = NULL;
321 char name_buf[20];
323 /* Try scheme specific env var first, unless http(s).
324 * lowercase first, then uppercase. */
325 if((scheme != &Curl_scheme_https) && (scheme != &Curl_scheme_http)) {
326 curl_msnprintf(name_buf, sizeof(name_buf), "%s_proxy", scheme->name);
327 env_name = name_buf;
328 proxy = curl_getenv(env_name);
329 if(!proxy) {
330 Curl_strntoupper(name_buf, name_buf, sizeof(name_buf));
331 proxy = curl_getenv(env_name);
332 }
333 }
335 if(!proxy &&
336 ((scheme == &Curl_scheme_https) || (scheme == &Curl_scheme_wss))) {
337 /* Not found, check 'https' env vars, also for 'wss'.
338 * Again, first lowercase then uppercase. */
339 env_name = "https_proxy";
340 proxy = curl_getenv(env_name);
341 if(!proxy) {
342 env_name = "HTTPS_PROXY";
343 proxy = curl_getenv(env_name);
344 }
345 }
346 else if(!proxy &&
347 ((scheme == &Curl_scheme_http) || (scheme == &Curl_scheme_ws))) {
348 /* Not found, check 'http' env vars, also for 'ws'.
349 * We do NOT try the uppercase version 'HTTP_PROXY' because of
350 * security reasons:
351 *
352 * When curl is used in a webserver application
353 * environment (cgi or php), this environment variable can
354 * be controlled by the web server user by setting the
355 * http header 'Proxy:' to some value.
356 *
357 * This can cause 'internal' http/ftp requests to be
358 * arbitrarily redirected by any external attacker.
359 */
360 env_name = "http_proxy";
361 proxy = curl_getenv(env_name);
362 }
364 if(!proxy) {
365 /* still not found, last resort checks. */
366 env_name = "all_proxy";
367 proxy = curl_getenv(env_name);
368 if(!proxy) {
369 env_name = "ALL_PROXY";
370 proxy = curl_getenv(env_name);
371 }
372 }
374 if(proxy)
375 infof(data, "Uses proxy env variable %s == '%s'", env_name, proxy);
377 return proxy;
378}
379#endif /* CURL_DISABLE_HTTP */
381/*
382 * If this is supposed to use a proxy, we need to figure out the proxy
383 * hostname, so that we can reuse an existing connection
384 * that may exist registered to the same proxy host.
385 */
386static CURLcode parse_proxy(struct Curl_easy *data,
387 const char *proxy,
388 bool for_pre_proxy,
389 struct proxy_info *proxyinfo)
390{
391 char *proxyuser = NULL;
392 char *proxypasswd = NULL;
393 char *scheme = NULL;
394 CURLcode result = CURLE_OK;
395 /* Set the start proxy type for URL scheme guessing */
396 uint8_t proxytype = for_pre_proxy ? CURLPROXY_SOCKS4 : data->set.proxytype;
397 CURLU *uhp = curl_url();
398 CURLUcode uc;
400 if(!uhp) {
401 result = CURLE_OUT_OF_MEMORY;
402 goto error;
403 }
404 /* When parsing the proxy, allowing non-supported schemes since we have
405 these made up ones for proxies. Guess scheme for URLs without it. */
406 uc = curl_url_set(uhp, CURLUPART_URL, proxy,
407 CURLU_NON_SUPPORT_SCHEME | CURLU_GUESS_SCHEME);
408 if(!uc) {
409 /* parsed okay as a URL - only update proxytype when scheme was explicit */
410 uc = curl_url_get(uhp, CURLUPART_SCHEME, &scheme, CURLU_NO_GUESS_SCHEME);
411 if(!uc) {
412 result = Curl_scheme_to_proxytype(data, scheme, &proxytype, proxy);
413 if(result)
414 goto error;
415 }
416 else if(uc != CURLUE_NO_SCHEME) {
417 result = CURLE_OUT_OF_MEMORY;
418 goto error;
419 }
420 /* else: no explicit scheme, keep the configured proxytype */
421 }
422 else {
423 failf(data, "Unsupported proxy syntax in \'%s\': %s", proxy,
424 curl_url_strerror(uc));
425 result = CURLE_COULDNT_RESOLVE_PROXY;
426 goto error;
427 }
429 result = Curl_peer_from_proxy_url(uhp, data, proxy, proxytype,
430 &proxyinfo->peer, &proxytype);
431 if(result)
432 goto error;
434 switch(proxytype) {
435 case CURLPROXY_HTTP:
436 case CURLPROXY_HTTP_1_0:
437 case CURLPROXY_HTTPS:
438 case CURLPROXY_HTTPS2:
439 case CURLPROXY_HTTPS3:
440 if(for_pre_proxy) {
441 failf(data, "Unsupported pre-proxy type for \'%s\'", proxy);
442 result = CURLE_COULDNT_RESOLVE_PROXY;
443 goto error;
444 }
445 break;
446 case CURLPROXY_SOCKS4:
447 case CURLPROXY_SOCKS4A:
448 case CURLPROXY_SOCKS5:
449 case CURLPROXY_SOCKS5_HOSTNAME:
450 break;
451 default:
452 failf(data, "Unsupported proxy type %u for \'%s\'", proxytype, proxy);
453 result = CURLE_COULDNT_RESOLVE_PROXY;
454 goto error;
455 }
457 /* Is there a username and password given in this proxy URL? */
458 uc = curl_url_get(uhp, CURLUPART_USER, &proxyuser, CURLU_URLDECODE);
459 if(uc && (uc != CURLUE_NO_USER)) {
460 result = Curl_uc_to_curlcode(uc);
461 goto error;
462 }
463 uc = curl_url_get(uhp, CURLUPART_PASSWORD, &proxypasswd, CURLU_URLDECODE);
464 if(uc && (uc != CURLUE_NO_PASSWORD)) {
465 result = Curl_uc_to_curlcode(uc);
466 goto error;
467 }
469 if(proxyuser || proxypasswd) {
470 result = Curl_creds_create(proxyuser, proxypasswd, NULL, NULL,
471 CURL_EASY_STR(data, STRING_PROXY_SERVICE_NAME),
472 CREDS_URL, &proxyinfo->creds);
473 if(result)
474 goto error;
475 }
476 else if(!for_pre_proxy &&
477 (CURL_EASY_STR(data, STRING_PROXYUSERNAME) ||
478 CURL_EASY_STR(data, STRING_PROXYPASSWORD) ||
479 CURL_EASY_STR(data, STRING_PROXY_SERVICE_NAME))) {
480 /* No user/passwd in URL, if this is not a pre-proxy, the
481 * CURLOPT_PROXY* settings apply. */
482 result = Curl_creds_create(CURL_EASY_STR(data, STRING_PROXYUSERNAME),
483 CURL_EASY_STR(data, STRING_PROXYPASSWORD),
484 NULL, NULL,
485 CURL_EASY_STR(data, STRING_PROXY_SERVICE_NAME),
486 CREDS_OPTION, &proxyinfo->creds);
487 }
488 else
489 Curl_creds_unlink(&proxyinfo->creds);
491 proxyinfo->proxytype = proxytype;
493error:
494 curlx_free(scheme);
495 curlx_free(proxyuser);
496 curlx_free(proxypasswd);
497 curl_url_cleanup(uhp);
498#ifdef DEBUGBUILD
499 if(!result) {
500 DEBUGASSERT(proxyinfo);
501 DEBUGASSERT(proxyinfo->peer);
502 }
503#endif
504 return result;
505}
507/* Is transfer's origin exempted from proxy use? */
508static bool proxy_do_not_proxy(struct Curl_easy *data)
509{
510 const char *no_proxy;
511 char *env_no_proxy = NULL;
512 bool do_not_proxy;
514 /* no proxying if the transfer does not use the network */
515 if(data->state.origin->scheme->flags & PROTOPT_NONETWORK)
516 return TRUE;
518 no_proxy = CURL_EASY_STR(data, STRING_NOPROXY);
519 if(!no_proxy) {
520 const char *p = "no_proxy";
521 env_no_proxy = curl_getenv(p);
522 if(!env_no_proxy) {
523 p = "NO_PROXY";
524 env_no_proxy = curl_getenv(p);
525 }
526 if(env_no_proxy)
527 infof(data, "Uses proxy env variable %s == '%s'", p, env_no_proxy);
528 no_proxy = env_no_proxy;
529 }
531 do_not_proxy = proxy_check_noproxy(data->state.origin->hostname, no_proxy);
532 curlx_safefree(env_no_proxy);
533 return do_not_proxy;
534}
536CURLcode Curl_proxy_init_conn(struct Curl_easy *data,
537 struct connectdata *conn)
538{
539 char *proxy = NULL;
540 char *pre_proxy = NULL;
541 const char *str = NULL;
542 bool do_env_detect = TRUE;
543 CURLcode result = CURLE_OK;
545 /* Enforce no proxy use unless we decide to use one */
546 conn->bits.origin_is_proxy = FALSE;
547 DEBUGASSERT(!conn->socks_proxy.peer);
548 DEBUGASSERT(!conn->http_proxy.peer);
550 if(proxy_do_not_proxy(data))
551 goto out;
553 /*************************************************************
554 * Detect what (if any) proxy to use
555 *************************************************************/
556 /* the empty config strings disable proxy use and env detects */
557 str = CURL_EASY_STR(data, STRING_PROXY);
558 if(str) {
559 if(*str) {
560 proxy = curlx_strdup(str);
561 /* if global proxy is set, this is it */
562 if(!proxy) {
563 failf(data, "memory shortage");
564 result = CURLE_OUT_OF_MEMORY;
565 goto out;
566 }
567 }
568 else
569 do_env_detect = FALSE;
570 }
572 str = CURL_EASY_STR(data, STRING_PRE_PROXY);
573 if(str) {
574 if(*str) {
575 pre_proxy = curlx_strdup(str);
576 /* if global socks proxy is set, this is it */
577 if(!pre_proxy) {
578 failf(data, "memory shortage");
579 result = CURLE_OUT_OF_MEMORY;
580 goto out;
581 }
582 }
583 else
584 do_env_detect = FALSE;
585 }
587#ifndef CURL_DISABLE_HTTP
588 /* None configured, detect possible proxy from environment. */
589 if(!proxy && !pre_proxy && do_env_detect)
590 proxy = proxy_detect_proxy(data, conn->scheme);
591#else
592 (void)do_env_detect;
593#endif /* CURL_DISABLE_HTTP */
595 if(!proxy && !pre_proxy)
596 goto out;
598 if(pre_proxy) {
599 result = parse_proxy(data, pre_proxy, TRUE, &conn->socks_proxy);
600 if(result)
601 goto out;
602 }
604 if(proxy) {
605 result = parse_proxy(data, proxy, FALSE, &conn->http_proxy);
606 if(result)
607 goto out;
609 switch(conn->http_proxy.proxytype) {
610 case CURLPROXY_SOCKS4:
611 case CURLPROXY_SOCKS4A:
612 case CURLPROXY_SOCKS5:
613 case CURLPROXY_SOCKS5_HOSTNAME:
614 /* Whoops, it is not an HTTP proxy */
615 if(pre_proxy) {
616 /* and we already have a SOCKS pre-proxy. Cannot have both */
617 failf(data, "Having a SOCKS pre-proxy and proxy is not "
618 "supported with \'%s\'", proxy);
619 result = CURLE_COULDNT_RESOLVE_PROXY;
620 goto out;
621 }
622 /* switch */
623 conn->socks_proxy = conn->http_proxy;
624 memset(&conn->http_proxy, 0, sizeof(conn->http_proxy));
625 break;
626 default:
627 /* all other types are HTTP */
628 break;
629 }
630 }
632 if(conn->socks_proxy.peer) {
633 DEBUGASSERT(!CURL_PROXY_IS_ANY_HTTP(conn->socks_proxy.proxytype));
634 }
636#ifdef CURL_DISABLE_HTTP
637 if(conn->http_proxy.peer) {
638 /* asking for an HTTP proxy is a bit funny when HTTP is disabled... */
639 result = CURLE_UNSUPPORTED_PROTOCOL;
640 goto out;
641 }
643#else /* CURL_DISABLE_HTTP */
644 if(conn->http_proxy.peer) {
645 const struct Curl_scheme *scheme = data->state.origin->scheme;
646 bool tunnel_proxy = (bool)data->set.tunnel_thru_httpproxy;
647 DEBUGASSERT(CURL_PROXY_IS_ANY_HTTP(conn->http_proxy.proxytype));
649 if(!tunnel_proxy) {
650 /* Decide if we tunnel through proxy automatically */
651 if(conn->via_peer) {
652 /* With connect-to, we always tunnel */
653 tunnel_proxy = TRUE;
654 }
655 else if(scheme->flags & PROTOPT_SSL) {
656 /* If the transfer is supposed to be secure, we tunnel */
657 tunnel_proxy = TRUE;
658 }
659 else if(scheme->flags & PROTOPT_HTTP_PROXY_TUNNEL) {
660 /* transfer scheme required tunneling */
661 tunnel_proxy = TRUE;
662 }
663 else if(!(scheme->protocol & PROTO_FAMILY_HTTP) &&
664 !(scheme->flags & PROTOPT_PROXY_AS_HTTP)) {
665 /* Cannot delegate transfer URL to HTTP proxy */
666 tunnel_proxy = TRUE;
667 }
668 }
670 if(!tunnel_proxy) {
671 /* HTTP proxy used in forwarding mode. This means the connection
672 * is really to the proxy and NOT the origin of the transfer. */
673 DEBUGASSERT(!conn->via_peer);
674 Curl_peer_link(&conn->origin, conn->http_proxy.peer);
675 conn->scheme = conn->http_proxy.peer->scheme;
676 conn->bits.origin_is_proxy = TRUE;
677 }
679#ifndef CURL_DISABLE_DIGEST_AUTH
680 if(!Curl_safecmp(data->state.envproxy, proxy)) {
681 /* proxy changed */
682 Curl_auth_digest_cleanup(&data->state.proxydigest);
683 curlx_free(data->state.envproxy);
684 data->state.envproxy = curlx_strdup(proxy);
685 }
686#endif
687 }
688#endif /* !CURL_DISABLE_HTTP */
690out:
691 curlx_free(pre_proxy);
692 curlx_free(proxy);
693 return result;
694}
696#endif /* CURL_DISABLE_PROXY */
Diagnostics4 git calls · 74 ms
CallStatusSizeTime074 ms
discover200152 B4 ms
git.upload-pack discover http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=3 git.response.bytes=152 git.server.agent=gitty/1.0 git.server.object_format=sha1 git.server.caps=agent ls-refs fetch object-format git.server.fetch=shallow filter sideband-all git.protocol.version=2 git.pkt.frames=8 git.pkt.data=6 git.pkt.flush=2 git.pkt.delim=0 git.pkt.bytes=152 git.pkt.payload.max=34
ls-refs200149 B3 ms
git.upload-pack ls-refs http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=3 git.response.bytes=149 git.response.cache=UPDATING git.response.duration_ms=3 git.protocol.version=2 git.pkt.frames=3 git.pkt.data=2 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=149 git.pkt.payload.max=78 git.ls_refs.count=2 git.ls_refs.head=refs/heads/master
fetchblob:none · deepen 10200287 KiB · hit29 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=41 git.response.bytes=293470 git.response.cache=HIT git.response.duration_ms=29 git.fetch.filter=blob:none git.fetch.filter.requested=tree:0 git.fetch.filter.fallback=blob:none git.fetch.filter.learned=false git.fetch.wants=31c911efe5652725e930f4d2e60c9060e5f6646d git.fetch.haves.count=0 git.fetch.deepen=10 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=10 git.pkt.data=8 git.pkt.flush=1 git.pkt.delim=1 git.pkt.bytes=293470 git.pkt.payload.max=65516 git.sideband.band1.bytes=293354 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=87 git.pack.bytes=293354 git.pack.ofs_delta=0 git.pack.ref_delta=1 git.pack.chain.max=1 git.pack.trailer=6a646bcda6740bab42e321b51998b52ea15146c0 git.pack.full=86Open pack map
fetch2006.5 KiB · hit41 ms
git.upload-pack fetch http.response.status_code=200 git.response.bytes=6647 git.response.cache=HIT git.response.duration_ms=41 git.fetch.wants=ae4afd8b03c74cb95151a415e33130a3b1b72f08 git.fetch.haves.count=0 git.fetch.deepen=0 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=3 git.pkt.data=2 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=6647 git.pkt.payload.max=6626 git.sideband.band1.bytes=6625 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0
Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.
- Remote
- https://5ad2236b39de4c8bd8f6270ea63f3ea9.artifacts.cloudflare.net/git/public-v0/curl.git
- Ref
- refs/heads/master
- Commit
- 31c911efe5652725e930f4d2e60c9060e5f6646d
- cf-ray
- a5e2033ced6370b8
- Request
- e511ef75…
- Protocol
- v2 · sha1
- Agent
- gitty/1.0
- Filter
- advertised
- Fetch
- shallow filter sideband-all
- Capabilities
- agent ls-refs fetch object-format