From 137623feee0b2b6bd55faa0063e9756c8b8e7b35 Mon Sep 17 00:00:00 2001 From: gcolpart Date: Thu, 3 Nov 2016 23:08:08 +0100 Subject: [PATCH] Ajout d'infos sur ab --- HowtoHTTP.md | 44 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/HowtoHTTP.md b/HowtoHTTP.md index 6a8b3b0c..67f19f55 100644 --- a/HowtoHTTP.md +++ b/HowtoHTTP.md @@ -1,10 +1,12 @@ # Howto HTTP -## telnet +Le procotole HTTP (HyperText Transfer Protocol) est un protocole client/serveur de niveau 7 s'appuyant par convention sur la couche de transport TCP et le port 80. Sa version sécurisée est HTTPS qui s'appuye en plus sur la couche [SSL/TLS](HowtoSSL). + +## Comprendre les différentes versions de HTTP grâce à telnet ### HTTP/1.0 -Le plus simple, entête `Host:` facultatif : +La version la plus simple, ll'entête `Host:` est facultatif : ~~~ $ telnet www.debian.org 80 @@ -33,7 +35,7 @@ Connection closed by foreign host. ### HTTP/1.1 -Entête `Host:` obligatoire : +L'entête `Host:` est obligatoire : ~~~ $ telnet www.debian.org 80 @@ -99,6 +101,38 @@ Server: Apache [...] ~~~ -## cURL +### HTTP/2.0 -Voir [TipsCurl]() \ No newline at end of file + + + +## Outils + +### HEAD/GET/POST + +~~~ +# apt install libwww-perl +~~~~ + +Voir + +### cURL + +Voir [TipsCurl]() + +### ab : apache bench + +~~~ +# apt install apache2-utils +~~~ + + +Utilisation : + +~~~{.bash} +$ ab -n 1000 -c 100 -l http://127.0.0.1/helloworld.txt +~~~ + +* `-n` : nombre de requêtes +* `-c` : nombre de requêtes effectuées en simultané +* `-l` : option importante qui tolère la variation de la réponse du serveur (si non, les requêtes seront notées en *Failed requests*)