Shakiba Moshiri
  • Shakiba Moshiri (شکیبا مشیری)
  • opt
    • high traffic site optimization
      • infrastructure check
      • infrastructure test
  • tools
    • Cryptsetup
      • Container encryption using cryptsetup
    • curly
      • ftp
      • ssl
      • http
      • dns
      • ip
      • email
    • SSH
      • ssh password-less login
        • Untitled
    • volumes and FS
      • installing Gluster fs on Ubuntu 18.04 server
      • Accessing Gluster FS from the client machine
  • CDN
    • How does a CDN work
  • Server Panel
  • DirectAdmin
    • DirectAdmin through a reverse proxy
  • Web Server
    • Nginx
      • Live Steaming with Nginx and FFMPEG
  • Security
  • Container
    • Docker Networking 101
      • why docker networking is important?
      • type of networking in docker
    • Docker
      • How to run gitlab-runner with docker
      • using vim inside any container without installing it
      • Cannot connect to the Docker daemon at unix:///var/run/docker.sock
      • moving docker images around using ssh and pipe
      • How can I make docker-compose pull images using a socks5 proxy?
  • Stack Overflow
  • Github
  • vmware
    • tools
      • how to install vmware CLI govc on Linux
  • Windows
    • How to Erase a Recovery Partition in Windows
Powered by GitBook
On this page
  • http
  • response
  • redirect
  • status
  • ttfb
  • gzip

Was this helpful?

  1. tools
  2. curly

http

http troubleshooting with curly

http

 -H | --http            HTTP actions ....
    |                   response: print response header of server
    |                   redirect: check if redirect id done or not
    |                   status: print status for the GET request
    |                   ttfb: print statistics about Time to First Byte
    |                   gzip: check if gzip is enabled or not

actions for HTTP

  • response (or res)

  • redirect (or red)

  • status

  • ttfb (= Time to First Byte)

  • gzip

response

check the response form the server

root[0]shakiba:/pp# curly --http res -d media.shakiba.net
HTTP/1.1 301 Moved Permanently
Server: nginx/1.14.0 (Ubuntu)
Date: Tue, 10 Nov 2020 12:33:44 GMT
Content-Type: text/html
Content-Length: 194
Connection: keep-alive
Location: https://media.shakiba.net/

HTTP/2 200
server: nginx/1.14.0 (Ubuntu)
date: Tue, 10 Nov 2020 12:33:44 GMT
content-type: text/html


option: http
action: response
status: OK

exit 0
root[0]shakiba:/pp#

redirect

check redirection of a domain

root[0]shakiba:/pp# curly --http red -d media.shakiba.net
HTTP/1.1 301 Moved Permanently
Location: https://media.shakiba.net/
HTTP/2 200

option: http
action: redirect
status: OK

exit 0
root[0]shakiba:/pp#

status

check status of the servers and more

root[0]shakiba:/pp# curly --http status -d media.shakiba.net
URL               https://media.shakiba.net/
status            200
remote_ip         185.8.172.233
remote_port       443
num_connects      2
num_redirects     1
scheme            HTTPS
http_version      2
ssl_verify_result 0

option: http
action: status
status: OK

exit 0
root[0]shakiba:/pp#

ttfb

measure Time to First Byte

root[0]shakiba:/pp# curly --http ttfb -d media.shakiba.net
url_effective       https://media.shakiba.net/
time_namelookupe    0.012499 | DNS lookup
time_connect        0.013454 | TCP connection
time_appconnect     0.049755 | App connection
time_redirect       0.005649 | Redirection time
time_starttransfer  0.057018 | TTFB
time_total          0.058207

option: http
action: ttfb
status: OK

exit 0
root[0]shakiba:/pp#

gzip

check if gzip has been enabled or not

root[0]shakiba:/pp# curly --http gzip -d media.shakiba.net
         compressed        uncompressed  ratio uncompressed_name
               1173                3591  67.8% /tmp/curl
gzip is enabled

option: http
action: gzip
status: OK

exit 0
root[0]shakiba:/pp#

PrevioussslNextdns

Last updated 4 years ago

Was this helpful?