10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5...

62
WWW WWW

Transcript of 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5...

Page 1: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

WWW

WWW

������������ ���� ��������� ����

���� � ���

���������! #"%$& &')(* +-,/.�021-,43/1-,65

7 8 3 7 +-9 7:7 ;�< .�=?>-9@1 8&A .CB

���������D �'FE�G�H&'2 * +-,/.@IJ,/.�K%021-,65

1 =2=L. 7 ;#< .�=2>M9N1 8OA .P=RQJ1�Q�+ 7 =RQ 7 1M0 A .

Page 2: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

URL

������������ ��������������������������! "�# $�&%(')+*-,/.10�2 342 5�687(.92 :�;(5<69=>,?.�0@,A;&BC.(21*-;&5�7&=D,/.10+;E.�,/F1GEG8G

HJI(KL;&0@;&5";MFNF ;POhttp Q ftp Q file QSRUTHJV�;/=D,A*(,/FXWY,/KZ:[,/K

HJV�;/=D,A*(,/F1*(;(5�7�=>,/.10@;PW179FXWY,/KZ:[,/K

http://www.univ.trieste.it/index.html

http://www.univ.trieste.it/pics/party.gif

http://www.univ.trieste.it/docs/list/primo.txt

Documento statico

\9]^

_a`?b>c9`?d@e�`9d

f"g"g&hji�kml�nmo�pYlqkr o�p�sXt�uwv�xzy[{}|+t�~��/�w���

�����1�@�

f}g"g&h�i�kY�}�mkYl+�nmk<i&�&�X�4���

Page 3: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Documento dinamico

�����

��������� ����

����������������� ���!�" � �$#&%('*),+.-&/102%43,56%(#&%70802%#&9&:73&5;%7<�5;9,+=+.9.>@?BA*CED

F$G�H7I�J

�1�����K����L1M����2N���*��O�P&QSRUT

��!VXWY�!Z[\[]Z^F$G�H7I�J

_a`cbedgf�hji(f�dgf�kKh*bedmln fodgh�p�q�hr`�b

Problema

s�t�u

v�wx�y�wz�{�w�z

|1}�}�~K�����1�����2�� �*�����&�S�U�

���B������&�X�a���������2���B�E�����(�B�g�����Y�  ¢¡o£¥¤ ¦8§¨��©&��ª�^�Y�7«��e¬ �®­���B���������¯&� �X�����°¡o£j¤�¦6§±� �X�B©&�r� «²� ¯ ��³X©����X¯,³����B©7�!�\�¨³�©®�X�;��´Y�E���^�ª�®­

µ�¶X·�¸1¹(º\»�¼½6·]¾7½;¿X½6À�¸a·�·�¶�·�¸(¹&º�»�¼�½6·�¶XÀe¼�¿&º�ÀÁ¸*·ÃÂÅÄ

Page 4: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Soluzione

����������� ����������� ���������� �����������

� �"!�#%$'& (�/ )+*-, . /

index.html

, 021 , 34/6587:9 3<;>=�3�/?1@/BAC, 0@, 7:DFE�G)IHJ/K069 025-L M

N index.htm, 0OE�G

�/nome)QPR/@3�5SDT1 , 3�/6587:9 3<;

nome

, 0K.U, VW7CDT1 ,U3�/6587:9 3<;X=�34/J1�/BAC, 0�, 7C/)+*-, . /

index.html Y9 =�=�Z@3�/

index.htm [, 02\ Z6/@. . DT1 , 3]/6587:9 3<;

�/cgi-bin)_^`Z-747W,a/bV�9 . ,�,-1�9�5BZ@cd/@0-7W,?, 0T\ Z6/JVe7fDT1 , 34/6587:9 3<;TV�9 069X1 , 06D@cX, 5-,

Osservazione

g�hdi'j�k`lfi m�i`n�o�p'i m�qrltsOivuwp�iyxyz6iyx

gQ{�|�}�~�� �a�-}v|@�'���"��~ }y�F�v|�����~ �������>�`��� ���������R�4���4�����'�����v���%��|@}��]��� ¢¡�����~J���R£�¤ �F��|J���%£B���W�e� �?¥@��|��y��|J���§¦%�¨��}��8� £B�©�©�`��|�}y�%� £B� Iª8|F«r¤�}�~ ��¥��y�?� �@� ��|��¬�'��~?­���~ �%�¨® �S���y���?�J�¯�]�R°@}���~J���'£�¤R�O��|J�W�£B���W�e� �?¥��`|����v|����

Page 5: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

HTML

( c e n n i )

HTML

����������� ������������������������������! "��#$�%�'&'()"*,+.-�/.0�-1-�* 2!3547681419 :;6<* =;4�6>4?:@2�AB4DCE2F6GAB0IHJHG076>4?812':�/�AB4�+.HK*

��L�2M:;/�AB4�+.HG2!N�OQPR)'(SHG419 HG2T:@2�+U:V27AW07+.8�*"8�*.CE2�6GAB0;HGHG0�X5* 2F+54ZY[� �F�]\�_^]HG0�-`8M4'9�:;6<* =I2F+52`:a2�AW4?814;=;4T419b9�4�6>4D=S* 9"/.07cd* XbXV0;H[2!*dc"8M21:;/1AW47+.HG2

[email protected] o7p

<B> questo va in neretto </B> ma questo no

questo va in neretto ma questo no

�_qr/507+.8M2s*,c't16u2�vm9�476�6<* :a4I=;4s/M+U812':;/�AB47+"H<2wN7OQP�)1(x�&B*d+.HG476<316u4;H[0%c 0�8M419 :;6<* X;* 2F+54w*d+`c,*y+.-�/50�-1-�* 2wN7OQP�)z &{CE0�|;*"8�* 9�4I-�+1*y+M* }~:a2�6<6�* 9�352�+;8M4�+.HK*59"/1c,c 2Z9�:;�.476GAU2

Page 6: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Tipica pagina w e b

<HTML><HEAD>

<TI TLE>Al ber t o Bar t ol i ' s Home Page

</ TI TLE></ HEAD>

<BODY>. . .

</ BODY></ HTML>

������� ������ �������������������������� ���! <BODY> . . . </ BODY> "�$#%�� '&(���*),+-�����.�/�0&1����),+-�2�3�*�

4�57698;:=< >7?A@�BDCE8-FG< @�>75

HJI @�>695K>ML69@N 5KBA@O5QPMBA@�PKBD< @�R

Tag <A>…</ A>S,T�UDV�T0W�TXUZY/W�T�[�\ ]J\ [K^�U_Ta`3b�\�c�dXW�TXUeb�\*f�g

<A HREF=“ URL” > t est o da evi denzi ar e come l i nk </A>

h Y;Tji1W�\ kZl<A HREF=" ht t p: / / www. uni v. t r i est e. i t / " >

Uni ver s i t y of Tr i est e</A>

Page 7: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Esempio

<HTML><HEAD>

. . .<TITLE>Teachi ng ( DI DATTI CA) </TITLE>...

</HEAD><BODY>

<H1> Mat er i al e di dat t i co </H1><P>Tut t o i l mat er i al e di dat t i co event ual ment e di sponi bi l e pergl i ar goment i sot t o el encat i s i t r ova sul<A HREF="http://www.deei.units.it "> web ser ver del DEEI </A>( sezi one " Di dat t i ca" ) .<P>E’ accessi bi l e sol o dal l ' i nt er no del l a r et e del DEEI<I>( no, non mi chi edet e di i nvi ar vel o. . . cer cat e di or gani zzar vial t r i ment i , gr azi e) </I>.. . .

Parametri (Attributi) (I)

The <A> element accepts several attributes, but either the NAME or HREF attribute is required....If the HREF attribute is present, the text between the opening and closing elements becomes hypertext.

����������� ����������������������������� ��!�"$#%"'&�(*)+#-,

<A HREF=” ht t p: / / www. uni v. t r i est e. i t ” >.0/21 3 /�45/�687+.�4:9 ; /�< 9=4:7?>�7�< 3 /�4:/�687+.�4:9

Page 8: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Parametri (Attributi) (II)

������������ ���� ����������������! "# �$&%'�����(�*)+�� ��,�).-/1032�46587�5�9�:<;�=>;�4?5$@A=B9$;C4D4E5GF�F�9/IH�9 J�K�9 LM9 N�;O@P2�7�9O2�J�K�9�:<;�=>;�4E5O@=>2/RQ&;�S 2�=B9�TMFU@=B9 K<J�V�5GW':$2CF�F�9YX�9 S 9�:<5�=&2�J�K�9�:$;C=Z;�465$@U=>2/RQ&;�S 2�=>5D7�9O7�5OLZ;�[CS @\F#5]9 S�:O;�=Z;�465O@=Z2�^D;GF_F_5�K$@P5

<BODY BGCOLOR=" #f f f f f f ” >

BGCOLOR changes the colour of the background … where"#rrggbb" isa hexadecimal red-green-blue triplet used to specify thebackground colour

Molti ta g . . .

Page 9: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Tag <I MG>

������������� ��������� ��� ��������� ��������������� �

!<IMG SRC=“ ht t p: / / www. uni v. t r i est e. i t / abc. gi f ” >"$#&%�'(%�)+*-,.'(/�01/324265 7 8%-,9/�'17 /4:

SRC ;=< *?>�7 @A7 >B%DC�EGFIH*�5�5 %�7 )J)K%�8�7 L�*MH%N7 L ; *3'17 '�*

!<IMG SRC=“ ht t p: / / www. uni v. t r i est e. i t / abc. gi f ”

ALT=“ f i gur a” ALI GN=t op>"$#&%�'(%�)+*-,.'(/ALT ;O< *?>�7 @A7 >B%D7 5O,A* ; ,1/PH% ; >�'17 Q?*4'(*N)R*�L�,.'(* ; 7 < '�*�5 *?Q�%N5 S 7 )M)K%68�7 L?*"$#&%�'(%�)+*-,.'(/ALI GN ;O< *?>-7 @A7 >B%T>=/�)K*M%45 5 7 L?*�%�'�*D5 S 7 )J)R%?8U7 L?*

ALIGN=top aligns itself with the top of the tallest item in the line.

!<A HREF=“ URL” > <IMG SRC=“ ur l ” > </ A>"WV37 <X?YD;O< *�>-7 @A7 >B%�'�* X L?%N7 )M)K%68�7�L?*T>=/�)K*DZ-[ < *�'15�7 L�\

URL relativo (I)

]_^a`cbTdfe4e�gih�jlkOgKmht t p: / / www. uni t s. i t / bar t ol i a/ i ndex. ht mnpo9qr�s-tvu wAu xByNz�s4u {?|6xBy�}Rr�s-t9rNz�sTq|�x�z�}Kr�s�t9|

]_^a`cbD~��ch�d�k�����g�m/ i ndex. ht m �������������N�4� �� �v�������������������� ���n�� |�sPu qr�s-tvu wAu xByNz�s�u {�|xBy�}Kr�s�t9rDz4sTq|x-z4}Kr�s-t9|

n��lu ��r�s�qrPq6yNz4s+xB|�s-t1r6 vt9|

¡�¢ �G�£� � �����¤�¥� ��� m]§¦ � �4�������6�.� ht t p: / / www. uni t s. i t / bar t ol i a/ i ndex. ht ml]©¨ �l�6��� ���� <I MG SRC = “ MyGi f / f i g. gi f ” >

]§¡4ª �¥� «4��� ��� mht t p: / / www. uni t s. i t / bar t ol i a/MyGif/fig.gifnp¬?t1r6 � �|D �r�­®{�r�­n�¯&|4 =u °Ou |�s?r²±&­�r4³ y-t.u {�yMyM´�z?r4³ ³ yMq�r�³�q|x-z�}Rr�s-t9|Px�µ?rP³ |Px=|�s-tvu r�s?r¶

Page 10: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Esempio

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"><HTML><HEAD>...<H1>Alberto Bartoli

</H1>...<IMG SRC="MyGif/alb-smaller.gif" ... >...<IMG SRC="MyGif/fig-did/Diapositiva2-80.gif" ...>...

URL relativo (II)

i ndex. ht ml

f i g. gi f

MyGi f

bar t ol i a

/ bar t ol i a/ i ndex. ht ml

i ndex. ht ml

f i g. gi f

MyGi f

home

pr ova

t est

/ pr ova/ t est / home/ i ndex. ht ml

<I MG SRC = “ MyGi f / f i g. gi f ” >

��� ������� ��� ����� �������������������� !���"��#�$� % %&������'������(�)�������*���+����,���� - � ���.�*#�0/�(�� &"������.1

<I MG SRC = “ MyGi f / f i g. gi f ” >

Page 11: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Osservazione:

N on “ f orm at t are” H T M L

��������� ��� �� ����������������� ������������������� �!�"�����$#%�&� �('*),+.-.�� /�� 0� 1/�2 �����3�

Osservazione:

V isu al izzazione non u nivoc a

4652798 :<;/8=8�>@?�7�A=B�CED�5 F�7G B2HID"JKJ�D�L�DNM�O J$B2P�Q&O RSRKP=F�70O�5TCU7"?/O VXWZY[;]\^8�W

_"`ba�c3c�d.e�f^g6hji�klajm�c!i�n�mld*opc!ajm

Page 12: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

HTTP

HTTP

������������� �������������������������� !��"$#�%�&('*)!+�,(+.-0/1.243!5638793$:;: 3<1>= 2@?BA(CD1>=E2GFH=!I�J KLJ;M(NO3$26FPKQ5�J 3$MSRTCQRT56=DFSRVU

��W 243!5638793$:;: 3XK<2YJ 7!A.J =.RT56KPZ[2YJ R\1B3@R�5GK��% J 7BA.J =.RT56=X=L2YJ R\1>3@R�5G=LJ]M_^a`cb�d\d

�fe M>I�J;1�= M�I@= M(5G=gI@KE:.:hJ i>= :;: 3jI�J�5�2kK8R(1�3$2k563��l = :\mnm<moR\J8pQRTKPq 'cW 703EFP=n:hJ iB= :]: 3jI�J(5�2kK.R\1>3$2k5G3

rQs8s8t u�t8vxwzy.{$|�} ~��Q�Y}@�.~��.�.�V���.y.}.��~4�Y�8{4{4���g���>�[�_� �0���T�6�O� �

Page 13: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Lato c l i e n t

�������http://www.w3.org/hypertext/WWW/TheProject.html

��� ����� ����������������� ��� �"!$#%���www.w3.org

& �('��*)+���,���-�.�/�1032�2 054����6��087:9

; ��!$�<3� 0�=�>�>?#8�@�BA�C���DE�

F@���G� ) �H<H��=�>�> #8�@��D*4����-DI�

J�KIL+MIK$N$OP KEQ�RSK$T

GET /hypertext/WWW/TheProject.html HTTP/1.1......<linea vuota>

HTTP/1.0 200 Document follows......<linea vuota><documento richiesto >

J�K$NVU�WIX�NYKP KIQ�RIKET

Lato c l i e n t:

G e s ti on e d e l l e I m m ag i n i

Z$[�\�]_^B`baSc�] d,]_c�[ cHe�fhgji(kEl?m�g�konqpBgrm5sGt(kIsvu*w,^:x-yBz%c3{*|$u:]�u }6c(]�u |�u�w�f1|�fB~I MG

�<I MG SRC=“ abc. gi f ” >… <I MG SRC=“ def . gi f ” >… <I MG SRC=“ ghe. gi f ” >…

�+� ^�]_w�u�{�chw(u:d,]_c3[�u cHeH^�[ ^"a�x c-~�[�u c�u�[:\�]6^B`baIc3]$�

���/� �6���V�����o�V���E�:�����8� �1�-������ ������ �o���� �����V  ¡¢��¤£¢��¥�¦:§@�©¨ª¥�«¬«�­�®B¥B�¬¥�¯

�����H� � �+��� �b°¬�±E�B�+²���¤£¢��¥�¦:§@�©¨ª¥�«¬«�­�®B¥B�¬¥�¯

�����H� � �+��� �³�6�-��´��� µ¶µ·µ

�¹¸:�B������� ���+�³������+�I MG�V  ± º�  �+²���� �����V  ¡¢�

�¹¸:�B������� ���+�³������+�I MG�V  ± º�  �+²���� �»°¬�+±I�B�+²��

�¹¸:�B������� ���+�³������+�I MG�V  ± º�  �+²���� �¢�.����´$�

�¼µ·µ¶µ

½+¾�¾ ¿�À�Á

Page 14: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Esempio

( I )

/~bartolia/index.html

<HTML><HEAD>...<H1>Alberto Bartoli

</H1>...<IMG SRC="MyGif/alb-smaller.gif" ... >...<IMG SRC="MyGif/fig-did/Diapositiva2-80.gif" ...>...

Esempio (II)

documento

documento

Page 15: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Unverifiable transactions

����������� ��������������� ��� ���������� ���! #"��$� %&������'(�)�+*-,.*0/!1324�5�6� �(� �)�7��8 ��'��9���:� ;<� �6��� �=�����'#�>�� ?��� -'A@

www. X1. com

. . .<I MG SRC=“ abc. gi f ” >. . . <I MG SRC=“ ht t p: / / www. f ast c l i ck. net / i mg48” >. . .

www. f ast cl i ck. net

ht t p: / / www. X1. com/ i ndex. ht ml

www. X1. com

Gestione delle connessioni

Page 16: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Premessa:

C o n n essi o n e T C P ( I )����������� ���������������������

� � !#"%$&$('�)%)+*(,-*/.10324*656* 7�98�* 2:'<;>=1?@=+*A;>?B01.�=BCD2E;F*/G#24* !#"IH(8�JKJMLNG1;O* !P'Q=+*A*/.1* RS* '<;>"Q'T ?K! 0%.U* T '<;>"

V VWYXDZ []\^[`_ba4a4c�dSd�Z/\fe V Z gh_i Z j+klZ c V \fmbcbg gon cqp-pAg Z6rEc�s�Z/\YjS_ut

vAp%_bX V ebXlcrq\Yj3jS_baEa4Zh\YjS_

≈ wyx�x

Premessa:

C o n n essi o n e T C P ( I I )

z|{y}%~��K�S�o�9� �Q�D�%�(���/�%� �-� �<� �%�<�E~��1�Y�S�B~�:�@�%���E���-���A�b���S�K~��-�+� �:�1������ �����3�(���u���

�A���% h¡6¢u£�¤¥¡/¦b§

¤¨&©Sª

«�ª

Send 16 KB

Send 2 KB Send 4 KB Send 8 KB

z�¬I�-~>��­��h®#�1�y�E~>�%�Y�S�B~�o�Q�1�-�4�3�<�6� �I®P�%���3� ®#�¯�-�<� �A�-� �o°9�S�1�����/±1�/� �

Page 17: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

HTTP 1.0

�������������� ��������� ������� ���������� ���"!�#����"���� $ �! �����&%('()

*+��, �-�.!/���10203! #�! �����-�546879�;:��"#1�<;�=���>�?:@!� ���,A! �>�?#B�����C! �����D<&��, �>��! <E<&F��!/��!

GIHKJML NPO�Q?RSL"T�T"Q�U$U�V/L�T"V�W�QXZY"L"R�[�J?Q�T=O2L$\6879��F���� ������1 ��E]�,A�^���"F_!/�E<`��:@! FEa�b�c

GIHdO�XeL�W"W�LfW�L^RgLfW�QXhU1[$W�QXei XeQENALjU�N/L�k�lmU�Oni�XCO(Y Vpo1q�rg\

HTTP 1.1 (I)

s�t5u�vwxv�y�t�z�y�{h|}z5z�t�~ygw�|hz�v���p���������������g��� �������������e���&���1���������������-�_���=�}�5w���w�z�y�t�uC���^w�|hz(w

�������"�����.���1�M�����/�� "���e¡ �E¢������1 "�j£^�1��¡ ���¤�¡������x£1���p�"�1�M��£�£^� ������������?���>���������1���/�� "�=���M������1� ¥I� �g���� ^�

Connection: close�A�?�^���_�����������1�S�

¦����>�;�1�>�>�E �����¥3�3���2�-�����¨§(©(¦?�ª�E�;�  "�D�;��¡ �e�.�"�A«;��¥n¥I� �1� �=���>�

Page 18: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

HTTP 1.1 (II-a )

����������� ����������������� ����������� �����! "��#%$%$'&(*) ��+,��� ����.-�� �����/0/�21�����������436587:9<;=�� ����>�<�'���@?A��� �B���� �%?C%���D

EGFIHJ�KML�N O�P>N KQKSR�T N U�N�V<O U�WXJ,U�Y�WXJZN UZY�UIOZH[WXJ�H�HOZ\�O�V�Y,K]J�U�WXO_^a`cbed(gf $%$ihkj�?l�m� �D�!�� an,�a�D�po

≈ qsr ` `

t�u v w�x y%z|{Ixa{I}~z�w��>v �u wM�Q��w�� �IwI}~y�x�w�z�w�}�}|�I��v w��

�.�Q�Mxa{IxS�����Qv xc��v ����u wZyX��y�y:wMv x�}<v wI�Qw

HTTP 1.1 (II-b )

�8���m�c���������"��A�����,���  ���¡.¢p£�¤¥����¦%� §�¨� 4£���§6¨� >©"£� �ª<¡e�c«~��¬6­¯®���§�¦, �¨� 4¨°� �� ,¦%£�¡D±� §6¨� �ª�¢�±m�aª< 2§6¨�  ©"£� �ª|¡.¢0¨�  �² a®0 ���¡��³´°µI¶�·�¸~¹D·I¸�º »"¹Bº ¼Qµ ·Q¸�·²¶[½0¾�»�¶�·6¿�º »�¾I¸BÀIº »�·"Á Â

�!ÃÄ£�§���®0±¥�����,���  ���¡.¢p£�¤!Å�§%¨X 6¢0��¢� �����������Æ%Ç®"� ÈÉ���0£�� ª��² 4���<ʲ®0 %� §aË���±%È!¢0�  �ª�ª�� ¦,±%Ì

�!ÃÄ£�§���®0±¥ÍaÎ%ÎiÏZʲ§�� ¡°±pÌ�Ç8� Ð  ,Å�Å� a¡B¡D±¢� �¨��� �¢0� ¡B±2®0§���� ÐÑ£�¡D ���¡D 2Ï!ª~ %�aª���Ò����  

≈ Ó_Ô�Õ Õ

Ö%× ¼,À²¼ Ö »a¾

Page 19: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Esempio di pipel in in g

���������������� ���� ����� ����������� �"!$#���%&� '(�)���*%+�-, �.�����/�0��� 21)3��� 4�-56�*�7'(�*�)�8�

9�:�;/<�:>=�?�@BA/C7D4E+@GFH:"IJE+@LKME+N�O-PQ:>E�R(SUTWV�XZY�[)\][/^7_`:aP2:>Ecb:>EdR�^�eGfhg&^�f�ijgkeGlhg�^7_

mon�n�pUq*rts�u�v2wxs4r

mon�n�pUq*rts�u�v2wxs4r

mon�n�pUq*rts�u�v2wxs4r

y�z-{}|)~�~2�Q���������Q����� �k�������8�����>����|)~�~2|���|�~��G|Q���x������~x�������������7{}|

� ���7~J����~(~J|��x��������|)~Q�����c|�z��7{}|�z��Z~2�7���}z*|�� � |-�6���J�0�M|)~�����z*~(|

HTTP:

F o r m a t o M e s s a g g i

Page 20: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

HTTP R e q u e s t

method requestedURL ProtocolVersion

Request-Header

Entity

�GET � �������� �� � ����������� �������������������POST � ����������� � !����"� !��#��!�$&%'�(�����(�)+*-,/.10(2�354�670(6�378#3 .390(89:�;�<=0>,�;�89:�;�<=?

@�ACB�DE@�AFD GCH�D A�I+JKA�LEM=J&I+H7J&INOM9P�L PQM9Jmethod R POST S

Request Header

TVU5W�X�Y Z [\Z"]>Y�^�Y_W�Z�ZHeader: ValueTV`a^�Y

HeaderZValue b Z�cO[�Z�XdX-Y�XfegW&eh] Z�ijYkW Y l#Y W�Z�^_^ mnX b Z�o�Y ijY o7m"]>Y�p(q(q�rTsr�Z�cO[�Z�lOlOegW&en]/Y�m�t�t>Y�u W�t Z(cvZxw b m�c�m [�Z�l#cY yzm(^_^ m�cY o�{ Y Z�X|l�m

Ts}�X'Z [ b Y�~

Accept-Language: en

Accept-Encoding: gzip, x-gzip

Page 21: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Referer (I)

�������������� ��� �������� ���������� ��� !����"#� ��� ������ �$"#� ���!�

��%��'&(���� �) �*��� �+�,'-�.!/!0214365�587 %9� �!��� :#�

�The Referer request-header field allows the client to specify,for the server's benefit, the URI of the resource from which the Request-URI was obtained(the "referrer", although the header field is misspelled.)

;8<>=�?A@�BDC BFE

Referer (II)

�It allows a server to generate lists of back-links to resources for interest, ..., optimized caching, etc.

�It also allows obsolete or mistyped links to be traced for maintenance.

�The Referer field MUST NOT be sent if the Request-URI was obtained from a source that does not have its own URI, such asinput from the user keyboard.

G8H>I�JLK*MDN M�O

Page 22: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Referer (III)��������� � ���������������������������! "�#�$���� &%('*)+-,.�/�10�2�3�!�4���55�6� 7� 80��" 0:9;6 ��7*0�6� <=<>0� 804�� �1�?6 (@���7����1���@ A�B�C�D#BFE�DHGIBKJ�8 A��� 7*0L���!�M���" NO 0�56 �: A�P0�����0�7Q ( �R��'

+-,A6M���#���M���S���9T�O ���7=�/0U7*0��3�$�/V��M0#63@��!V��M���� (@���7����W���@ A����R�!�L�� 2�63 �R�"����!����X (Y�1���! (����5�56� 7� H0��& %

X1.com X2.com

X3.com

Y.net

GET /images/img43.gif HTTP/1.1...Referer: http://www.x2.com/sports/index.html...<linea vuota>

Host (I)

Z\["]^�_!`(a bOa c*dLa3eMf�^�g�h�^�gSdUc�i�a@j/]�akgP^�`l`8d4e d4m#n#npo�q#^�r�i!^f�`

Z-s�^ut v�gPd f@iwM^�g�b&e3i!xSyz({P{�{}|3~��Q���Q�.�����Q|��l�"���O�/��~�~&� ��~��$�"� �M�@���"��� |��$�/���~�~3� �>������M�>��|3����������=�

uts.univ.trieste.it

Page 23: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Host (II)

������������� ����������������������� ���� ��� ��!"�#%$&!� '�#( ����)�*# � �+�,��'��-!��.!���/10,23��465���1�*#%!�7 8*9

www.a-company.comwww.another-company.comwww.a-third-company.com

GET /index.html HTTP/1.1...Host: http://www.a-company.com...<linea vuota>

Host (III)

:<; = =?>.@)ACB�D�EFDHG�IJ)IG.K EML�J�GON�J�PHost Q:SRTKVU3J�W6L�E�X1Y*Z[D�\]P^Z _)L�Z J�N�JIG.`�D&Z%D�NaZ%PbZ c,cdE&Re>fNaZ I�J�PgX�EMh�J�P�E�\aD�Z�X�Z YiE&E�XVh�Z Y�GY�E

GET /index.html HTTP/1.1...<linea vuota>

www.a-company.comwww.another-company.comwww.a-third-company.com

Page 24: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

HTTP R e s p o n s e

ProtocolVersion StatusCode ReasonPhrase

ResponseHeader

Entity-Body ����� ������� ��� ����� ���

� ������� ����������� ����!"� � � �"�#�����%$&OK;&Moved Permanently;&Not Modified;&Bad Request;&Unauthorized;&Not Found;&Internal Server Error;&Not Implemented;&...

Response H ea d er

')(+*-, . /102/435.768.9*�/:/Header: Value

'Header

/Value ; /=<>02/?,�, .�,A@B*�@C31/�D%.E*?. FG.1*�/=696 HC, ; /:I�. D%. I�HJ3K.7LNMNMPO

'QO�/=<>02/-F"F>@5*�@C35.�H-R1R5.8S?* R?/=<�/T.E*�DU@5<>0VH:W�. @B* /J3K. X�H=<�. @4F+. ; @CHN6E6 HY<�. , ; @Z,[F>H

\:,]/Z0 ; ._^Date: Sun, 06 Nov 2003 08:49:00 GMT

Last-Modified: Sat, 05 Nov 2003 08:49:00 GMT

Content-Type: text/html; charset=ISO-8859-4

Content-Length: 3495

Content-Encoding: gzip

... `5a"bdc:eUfdgdhibje_k>g�l]mon k�pqgAr�sin c bg[t�t7h s8uvg e�gqgdh�w�n uAfdpxbdc:eyn

Page 25: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Location (r e d i r e c t i o n )

www.x1.com

GET /index.html HTTP/1.1Host: www.x1.com...<linea vuota>

HTTP/1.1 302 FoundLocation: http://www.x2.com/a.htm...<linea vuota>

www.x2.com

GET /a.htm HTTP/1.1Host: www.x2.com...<linea vuota>

HTTP/1.1 200 Document follows...<linea vuota><documento>

Esempio (I)

www.univ.trieste.it

������������ ���������������������� ����!���������" "��#�$���&%'(�) ���*,+

- � ."���!/'#� 0�)�!#�132(/4�657$8�/�9

�!����."��8:;:<#=� �?>�1 ������ �#=���1 1 #)���(���<$���/'#�!�1 1 #)���!�����$;$�� �!��

documento

Page 26: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

documento

Esempio (II)

uts.univ.trieste.it

Ricapitolando...

GET� POST ������������ ���� ��������������� ����� �! ��"�#�������$��%'&���(�)���� *,+.-0/ Accept-Encoding:12�354 +�687:9.;#<=6> "?�@! � A *�-�;�B5;DCE; 4

POST1

����������F��� ���G� ?! ��" H0��(��@�0EIG��)�� �G��(�:��"��J��(:��#�?K���"����&���(�)���� *,+.-0/ Location:, Content-Length:12�354 +�687:9.;#<=6> "?�@! � A *�-�;�B5;DCE; 4

GET1

Page 27: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Osservazione

�HTTP è enormemente complesso

� V ed i a mo solo u n sottoinsieme

� S empli f i ca to i n a lcu ni a spetti(principalmente, cach ing )

Invio dati al Web server

Page 28: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Invio dati al Web server

���������� �� � ������������������������ �"!$#%� �&����#'�(�)� #%*+�,�-� ��� �,. /(/&0�1(�2�3�-��#%45�76��24������2#%� �8� 49�76�� ��� :��74;� �-4;�

HTML FORM

< FORM ACTION = "/script" >

...

</FORM>

<�=">8?A@�>8?CBCDFE">�G

HJILK-M�N%O;PRQSKT-P�N%M"U-V WXT-M,V�TZY�K�V�[ \�K7O]M T7O;M,^�K`_�V�T�N%M a8Vba MdcP2OeV

HJILK-P T`c�Wdf�V MXT`MS^a M�gAK-O;W�[ \ M [ M(ghM T-O;WjiFNFKk"g�V OmlFn

HJo(W�N9Oea8KV NpY�V�K�T-P�N9O�a8VbT`q�PS

Y+WXTrOeK-OsO�V�V7c�P2O�V�V�T2N%M a8V O�V

HJt�TFf V P,K�T-P,u v(v&wxa M"y�K-M�N%OzP [�[ \�{}|�~/script

Y�W�T7O]M(T`MXT7O]MS

H�~�\�{}|C~LcM([�^-P a P�ghM2Oea�WACTION

^K-_AM�NpN'M a MdP�NpN'WX[�K-O;W

Page 29: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Esempio

������������� ���������������� ��������PARUSER=Pi ppo&PARPWD=Vol ant e

< FORM ACTI ON = “ skyl i ght . cgi ” >. . .<B> User name: </ B> < I NPUT ... NAME = “ PARUSER” . . . ><B> Passwor d: </ B> < I NPUT ... NAME = “ PARPWD” . . . >. . .< /FORM >

* * * * * * *

Pi ppo

Vol ant e����� �"!$# %'&�(�) # *�*�(�+,�.-$(�)0/$12�034%�5�126

Form elements ( I ) :

I NPUT TYPE = “ t ext ”

<INPUT TYPE="text" NAME=“ al f a" SI ZE=30 MAXLENGTH=50>

798;:=<�>�?@:A<CBDE:GF HID;JK>L<�JM>@NODQPR:A<�S$>LT�:=TU>t ext V7980?WTUX�?ZY�[\B ?WTU?�J]JK>LT^: _`F HID;JK>W<;JM>R<>aN�D�PR:A<�S�>WT^:ATU>b?LF�cd?OS$S;: cfe@g�[ V7ihjF;k�?�JMeR:A<�S�>WT�: JMeblQ>WT�TUm@:A<�lE: ?�JMeZ?OS�S�eGBQ: ?�JKeb?WF�<�eLcf>

al f a

7I NPUT TYPE=" passwor d" n ?W<�?WF eGXOe�_o :=FGpOT�e�qrS0>WTs<�e4<dlL: S;D�?WFA: t$t�?a:IF;JK>GS�JMeR:=<QS0>LT�: J�ebk�?WFAF HID�JM>W<�JM>�u

Page 30: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Form elements ( I I ) :

I NPUT TYPE = “ r adi o”<INPUT TYPE="radio" NAME=“ bet a" VALUE=” b1” checked >Hehe

<INPUT TYPE="radio" NAME=“ bet a" VALUE=” b2" >Haha

<INPUT TYPE="radio" NAME=“ bet a" VALUE=” b3" >Hoho

��������������� �������r adi o � ��������������������� ��! �"����$#

��%$&�'(' �)�(���&*�+�,-�.��! �/�0���(�1� �NAME 2

��3.�4!5! &��� �6��&�78 ���8�9� �:; ' �(��&(<4=����)�>��??���5��= &*���bet a=b1

Form elements ( I I I ) :

I NPUT TYPE = “ submi t ”<I NPUT TYPE=" submi t ” VALUE=" Spedi sci / Send” >

<I NPUT TYPE=" r eset ” VALUE=" Cancel l a / Er ase” >

submi t @A�B�C�D�D�C�E8F9GHC�EJI(F4E�D+K>CML�NVALUEA�O P�Q(K>FSR-R�L C�E�F�Q(K�CST�C(GUPVN PWD+K�PRUX�L R-R�L C�E�FYI(F4L�IP�D+L�I(F4N�Z[C.K�X

r eset :A�B�C�D�D�C�E8F9GHC�EJI(F4E�D+K>CML�NVALUEA�O P�Q(K>FSR-R�L C�E�F�Q(K�CST�C(GUPVL�NSK\L D�C�K;E�C�I.L�D�]�D�D+LSL�Z[C�K�X^F4N FX_F4E�D`P4N�T8P4N C�K�FVLaEL b�L P4N F

Page 31: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Form elements ( I V ) :

I NPUT TYPE =“ checkbox”<I NPUT TYPE= “ checkbox” NAME=“ pi ppo” VALUE=“ pl ut o” >

������� ����� ����������������� � ��� ��������� �"!#� �����$�&%'�(�*)+� �,�-��. ����/��0#0 � �1pi ppo=pl ut o 2�435� �&%6� )7�"���&�8�����7!#� �����$�&%9� �/)7�8�,�-�:� .8�;� �< %9��� ���&� !��#)7�"���=��$>?.�� �-�=����� �#)+�����=�#@

Form elements ( V ) :TEXTAREA

<TEXTAREA NAME=“ gamma" ROWS=2 COLS=30>Def aul t t ext . </ TEXTAREA>

ACB#D EGF H�I�DKJML-N�O9H?PQP R"S8P D8TUFQI�N�V8F P WXV�Y=D�IZY[D]\8V�^:F;I�L�D�O�FQO9D$Y=D L_Y[H?`ACa�R�O9D EGF H�I�D�N/H�I�LMF L�Y[D$b?F�cdO�F Efe�DDhg(i�N/H?P H�I#I�DG`AkjlI8F m�F R�P n7D"I�Y=D�N/H�IZY_F D"I�D$E?F o

Def aul t t ext .

Akjpb R�YlF*q�D�O�O9R�I#I�H�R L,L-H N�F R�YlFZR�P I�H"n+Dgamma

Page 32: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Esempio (I)

<HEAD><TITLE>Deitel Guest Book Form</TITLE>

</HEAD><BODY><H1> Guest Book </H1><FORM ... >...

</FORM>

Esempio (II-a )

<PRE>Email address (*): <INPUT TYPE=text NAME=Email>

First Name (*): <INPUT TYPE=text NAME=FirstName>Last name (*): <INPUT TYPE=text NAME=LastName>

Company: <INPUT TYPE=text NAME=Company>

NOTE: (*) fields are required</PRE><P>

�����

Page 33: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Esempio (II-b )

...Select mailing lists from which you want to receive information<BR><INPUT TYPE="CHECKBOX" NAME="mail" VALUE="mail"> Snail Mail<BR><INPUT TYPE="CHECKBOX" NAME="c_cpp" VALUE="c_cpp">

<I>C++ How to Program &amp; C How to Program</I><BR><INPUT TYPE="CHECKBOX" NAME="java" VALUE="java">

<I>Java How to Program</I><BR><INPUT TYPE="CHECKBOX" NAME="vb" VALUE="vb">

<I>Visual Basic How to Program</I><BR><INPUT TYPE="CHECKBOX" NAME="iwww" VALUE="iwww">

<I>Internet and World Wide Web How to Program</I><BR><P>

<INPUT TYPE="SUBMIT" VALUE="Submit">

Raccolta

�������������� ��������������

����� ��� !"�#�$��%&%'�(� )��*+!��-,.-/��0��213��4��$��5"5��$������� ,6�7/

Page 34: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Quando raccolgo ?

<FORM . . . >. . .<I NPUT TYPE=“ TEXT" . . . >. . .<I NPUT TYPE=" SUBMI T" VALUE=" Submi t " >. . .</ FORM >

����������� ���������

I NPUT TYPE=“ TEXT”����������� ����� �!�#"%$'& (�)I NPUT TYPE=“ submi t ”

Come rappresento ?

*,+.-�/ 02131'4 5!6�7�1 08134�6�9�:<;�7=�5>;?4�;@1 =#A�/CBDB�E�6 0F0G/ 021�1'4#HI4�/JH�4�1 BK/L5!027�1M4�N�/

*POQ6R7S6CN�;�9 6#5!;�4�;TA�/U7V0G6W-�6�9'9 /#5XA�6CB�1 :Y1 BD/Z-?13[U\�]^O_Y`baUcRd�eUf3f8gih�jXk�l'm�n�joe�prq�s

*,+t4#A�7�1u=v/Z/�A�A�7w;�5Q5�1 =v/Cx�1 ;�4�6%yz|{�}�~t� �������C�K�t�C����� �

nome=valore�t�C}D�!�K�w��}X�K�w���������������S~2��}����

& �z|� �D���>���V�������S��~Y��}K�F�K���Q�!�C���+

customer=John+Doe&address=100+Main+St.&city=Trieste

Page 35: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Esempio

[email protected]&FirstName=Bartoli&LastName=Alberto&

Company=&mail=mail&c_cpp=c_cpp&java=java

������������ ����������������������� !"�#��$�!%"&'��(*)!%�� +!��� �,�-+��.����� �0/�12�!/�3�422526

Trasmissione

7#8:9"8<;*8>=@?�ACB�8EDF9!GHB�I

JLKNM�OQPH? GSR0TVUW=X;�YZ= 8\[J^]H8<;`_badcN8fehgjidck[lnmpo�q'r�m`spmCtut�qpvxwzydt|{~}x�d��w����

Page 36: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

A quale URL ? (I)

<FORM ACTION=“ ht t p: / / someSer ver / someScr i pt ” . . . >. . .</ FORM >

��������� �� � � ��������������� ��� ����! "�# $�"� � %�&�(')�+*-,.�& ACTI ON�����"�-'/��0� �#21

�/ someScr i pt 3 ,-�"�4'/ 657'/�889

�:�;=<�>�>@?"���-���� A�%�;��# A�.�&��'B'/C=,-�ED- 6��,68F���.�& GD$�H�.I8"� �# IJ

A quale URL ? (II)

KILNM

OQP�R9SIP�T&U�PIT

V�WXW6Y[Z]\_^�`_a#b�^)\c a#b@d�e.fhg�ikj%l�m!eon�pqe.d�ermsm&ed�t%u�n�pqe.v�pqt�i�ikt

/someScript

/someScript

VXWXW6YwZ]\_xXy�\_^!z`�\�Z/someScript

{ T)|4}ATB~��G��~/someScript

�h�0� ���_���.�������[��� ���� �����_�X�_�(���

/someServer

Page 37: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Costruzione

H T T P R eq uest ( I )

< FORM ACTION="/script" METHOD = GET >

...

</FORM>

<FORM ACTION= "/script" METHOD=POST >

...

</FORM>

GET /script?<Dati del form>

Request-Header

Empty-Line

POST /script

Request-Header

Entity-Header

Empty-Line

<Dati del form>

Costruzione

H T T P R eq uest ( I I )

<FORM ACTION= "/script" METHOD=POST >

...

</FORM> POST /script

Request-Header

Entity-Header

Empty-Line

<Dati del form>

Content-length: ...Content-type: application/x-www-form-urlencoded

Page 38: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

GET vs POST

�Authors of services which use the HTTP protocol SHOULD NOT use GET based forms for the submission of sensitive data, because this will cause this data to be encoded in the Request-URI.

�Many existing servers, proxies, and user agents will log the requestURI in some place where it might be visible to third parties.

�Servers can use POST-based form submission instead

(RFC 2616)

Sui documenti dinamici

( cenni di cenni di cenni)

Page 39: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Documenti statici e dinamici

������������ �������������������� "!$#&% #('*)+% ,.-% /$)0,$-0)�,�'1)023)0,�'1)4-0506 6 7 508*8*% 9;:+-0)06 6 5=<?>>A@4B�)$CD.)E#(' F>�% /E% G&5�2H)0,�'I)�J0KI% 6 )L#&D�6NMO)?PQ#R)08S9.)08

������������ ����UTV�1WX�VYZ�[�\��� ^]_8`)$5�'*:a5�6 6 7 508I8I% 9;:+-%.D0,$5b<?>>�@aB�)$CD.)�#(' "B\% #&D06 '*5�'1:a-0)06 6 7 )E#c)$G;D$de% :,$)L-%.D0,=/�8`:Ef8g5�2L2H5a#&D06NMh)0P4#i)08S9$)08G&:,+% ,0/ED�'�)�#('(8`5�'g'*:a-�506 6 5=<?>>A@+B�)$CD$)�#('

�kjml��\���\=�� ��&n�l�no 0p��n �?n�q��� ��srR�tWXTA�uYwvxWX�&�zyg� "!$#c)02a/�%�G�:?24D0,0%{J

|~}E� �i�N� �S�&�[�O�.�e�`� �������c�h�S�i�V�X���&�E�i�m���&���N�����(���|U�����$� ���m�.�������.�N� ���S�t�����������&���[�h���;���S�Q�����|��

Esempio

�;�i��&���� 

¡ �[¢\��£U���� 

Page 40: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

“L e g a c y s y s t e m s ”

����������� ����������������� ������������������������� �!�"�#�!�����$�&%�� �&'(��)&����$��*��$��+,� *-� .+��/ � /0����� ��� �1�������2�����#����� ��������3��42'(��)

�65!��/0���,/�%���47��������$�1�8�9���8�����:���8���;�8�$��*��$��< �<�����7� �=�>�@?A���2��� �

BDC>E�F�C>G�H!C�G

I�GKJ8L�GNM>O�O&M

P�QSRTQSUWV�X$RZY�V0[=X:RTQ\XTX$Y�]^Q_"`"`�PaRTV\b2c\V0[=X

degfhcSUWVSi�Xjek_"`�lnmo VSR�_"`"`�PaRTV0[ o e#i0[KV

phq2r�s"t�uv u vNw qx

Importantey�zW{>|{�}$~�}${1�~��-��|~+�-��|~8�,� �#~

≡ �!� {!�-���7}${1�8}$����}$~��<� ~ � �,}N� ����� { �0� ~<������|����7� {�| �

y6�-���\�����8�j���A���n���0�����n�g�j�����j�W��� �

y6¡>{ � ����| � ~�¢8����� ��£ ��{��2¤({�¢ � {�}Z¥�{�}�¦§©¨8ªS«2ª(ª�¬­ª"®!¯° ±:ª³² ´¶µh´·°�¸±Z¹�®!±Zº�»(»³°^¼#½"ª³¬\°^¾=±Z¹2«#º�¿"¹ ° ¿À¯¿"º ¸S¹!±ZÁg° ¹!¿"ª(Â!°gÃÄ° Å ª ¬ÇÆ2¬K¾Äª»¸�±Zª#ÃÄ° ¬h¬hºS¾@º³ÂºÅ Å È º»(»(° ¿° ¬K¾=±$ºS¾@¹!±Zª

y6¡>{ � ����| � ~�¢8����� ��£ ��{�� �\É��0� {��Ê~!������|8� �0� }$~ � ��}\¦§ÌË�Â!°Í±A° ¾:¾K°#Â�°2¬Ç¼#±A° ¾:¾K¯±ZºÀ° ¿ÏÎ�¯ ªÅ Å ºÀ¸#¹�±:Ág° ¹!¿"ª(Â!°^ÃÄ°ÍÅ ª�¬NÆ2¬N¾Aª»ÐªS«#¹!¿"¹Ñª ¬�¬Çª�±:ª(®�ª�¬K¾K° ¾=°^¼0¹!¿ª ¬K¾K±:ª»kº(¼S¯�±Zº

Page 41: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Moltissime architetture...

����������� ���� ���� ����������� ������ �! ���" ������������ ���� ���� �$#%���&�'�)(+*-,.������� ���/�� �� ���� ����������102�� ���� ���"3���!�����54 (6*378�902�8 ����3�:�� �&�;4<,��>=14 (6*>78�?������� ���/�� �� ���� ����������102�� ���� ���"3���!�����54 (6*378�902�8 ����3�:�� �&�;4<,��>=14 (6*>7@#�������)������� ������ ��3�:�� �

���������102�� ���� ���"3���!�����54 (6*37@#A�B�����102�8 ����3���" �&�&4C,���=14 (+*>7D#�������)������� ������ ��3�:�� �

� E.FDGIHKJML�NPORQTS�U:UVU

HTTP C a c h i n g

Page 42: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Caching ( I )

����������� ������������������� ��������� �"!#�%$&� �('��)�'��!*���+�)� �,���!#!#��'�� �-��'��� ��!#�%���.�0/21�3�1�4%576

89� ��� �%���0/-:�;�<>=�;?6@�A���B$�CD� EF� !#�G�H��JIK�G!#�&�L�A���2� �NM9O7PRQTS

��U���� !#�VMWOXPRQTSY�Z�+!#�G!�[ ��]\���C �(��� ��^*�

�VM����DCZ� _`_L�Na����,� �HbV�D�c!#��!G[ � /ed�57f�g�3�1G;hf%=�3�=�=�3?i,5kjl<�d�57i,m�5Xi�6�on9C ���2� �+�����,�

��p�� ��C �*^*��a������ �Hbq'���C������r^*���7��C ���s�*�A�)�F� ��!#�N�s�q!`��!G[��

URL Entity... ...... ...... ...

Caching ( I I -a)

t7u�v�w.uGx�x�y{z|�},~B��� �G�*�&���*�A������� �����#��y �*����� u�wH��v �L�

�e���B���D���B�s�&�&���Z� �������(������W� F¡(¢L�G�"�N£*�&�>¢L��T�D�����W�Z���¤�����(�& F� �7�D�(¥¦�� R§��G >¨|J©)�������`�&��ª�u�v �&«�y �w�¬+�#�%v*� �&~B� w,y �%v

�e���B�?§���s­&�s� ���T�&�0�� 2���G¥#�B� ¥L¥��Z��0�&®9£������¢L��¥L¥¦��  �V�&�&�,�W� e¡°¯7�&¢L¡��&�l¥F¨|�}-v �KyD� ���`w-� ��� �������`�&��� uGwH��v*�A�c±��%�9��v*�`u��*¬ ����yZv wH��� u��Lw�y �%v*�

�e���B 2�­%£G¢L�s� �k������W� F¡c¢`����X��¥ ���D��#²³�D�&��­0�&�0� e� �7�D�(¥¦�G �§��G H¥´����­B���s���T�G .�B�­�s�&����¯7 2�Rµ��D��¥e¨

¶�·�¸X¹%º#»½¼A»>¾�¸?¿,À y���u�v wHu�x&xKy��G±T±��GwHw,y ��y�ÁV~+�%� w.�0�#�)~B���Dy �#uGwH�hz|JÂG� ��Ã����)v�ÄLu"��y&¬&y w|ÆÅ��%�2Ç � �&uG�

Page 43: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Caching ( I I -b )

������������� ����������� ��� ��� ������� !� "$#��������&%� '���(%��� )�&% �(* #�+,�-���. 0/ � � �1� � �2�3 45617�8:9 ;�<-7>=�?�7A@�BDC EFB�8:G�=-7H9$I�G�J$J KL7HMNG�=2E3OPG�MNB�=Q7FR SA7H<�G(7T9 EVUW9$7�8X9 ;�<-7>MNB�7NY�MZ=[GMZB�E3OP?(=�EFB:\(9�])]HB�MNB(=-7>]HMZ?28_^`<QG�7W^`?�Y�J$\:@�BaMNB�7NY�MN=�B(\:@�KL\(9�MVB�Ib7cI1?�8&8dY�=�9$I�G�7e9�?(=^`9f7H<L7g<�Ba?�MN9 ;�9�=aEFB�M'hiB�Mkj

Basic cach in g r u l e

lAm�n(okp:q1rAsktvuwyx�zX{(|~}������(�����a�-}��.�)���a�����0{���� �2�{d�Q},���Q�����)���3� {�}��.�����

w��-�-�!�,�g{��N}Q� �1���d���Ts��boP�������b�~}�� �F�:�������P|������3���)��� �a�b���2���w��~�¡ ���z�� �Q��{:��� ����}��

¢'£�¤Q¥§¦N¨�©�¥$ª�«¬~¥§­�®

¯ q.t�n�° n��0mAskt�

±�²�³a´�µbµF´�¶N´�²2·H¸�¹�¸ º�º�»(·g» ¼!´A½i´&´�µ�µ'´�¶N´&¶N¸¾½i»�¹�¸�¿�»�·H»

Page 44: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Expiration tim e ( I )

��������� �� �� ����������������� �!���"#��$&%'�!�(Expires: expirationDate

�*)+ -,�.�/'0�132�4507698;:<294=,?>@ BA;�@ BC3 DE�&F7A�G@ �#����H�JIKDL���;(Expires: Thu, 01 Dec 1994 16:00:00 GMT

MNCO�&P�F �NQRS(�UTVF �9��WXDYW+�Z

Expiration tim e ( I I )

�If there is neither a cache validator nor an explicit expirationtime associated with a response, we do not expect it to be cached, but certain caches MAY violate this expectation (for example, when little or no network connectivity is available).

�A client can usually detect that such a response was taken froma cache by comparing the Date header to the current time.[]\;^`_�aYb9c+b�d

egf�hji5kNl�m�n�ophYqsr�t@o&ujh�uKvwhr3i3opk@uxhym zDate { txkY|@t@oJ|�mY}@uxk�~����!� \ tYrL��h�uYr]t������

Page 45: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Validazione

�������������� �����������������������������! ����#"$�%�&���'"(� �)�#�+*#�!,!���)-(.Last-Modified: lastModificationDate�/ ��)-10�,)23� ��,)-4�+����,5)�)�� 6�����'�#���7�8�6���'�79:9;��"<"(��,5�=�#,?>'@BAC�D�&�����1� E�� ���#,)2 �=F

GET requestURL HTTP/1.1If-Modified-Since: lastModificationDate...<linea vuota>�/����� ����������������G.

H304 Not Modified I ������EJ,+A��'"(� ";KLNMPOCQ=QSR�T$UH200 Document follows I �&���6A��#"(� ";KL

�WVX,)�'"Y,7�=�1� �=�8�Z���)-��)�#"[� "\K]>&�1-4���J����F�/ =-4��^�2 �� _�`.)ab2 ���7cd�'c��7e

Validazione indip endent e

dal c loc k ( I )fhgji!k&kml)n=o pCqsr_tXoCu�l�vwo t�l!x#o r�n#izyN{�|C}~kCr�n�t1o x#o r�n#l)v i��fh�j�P�������#�G�1���5�b�X�=���`������������

f��(v�p�i���u�i)�Xl�pJp�r�k�o l%r�1n�oCu�i)�;p�o r�n#i%t1o�=n#l%i�n#�[o �\��l!t���n�l_p8���$o3n���l�yETag

�f���i)�;p'o r�n=o't1o u�i)�;p�i_p�r1n�r_lpmp8r=k7o l7�<i%l_p8�[�$o3n#���#i%t1o u�i)�;p�if�����n�o��}�}��6 �i�p'¡#r�n7p8i%kCr�n'��o i)n�i5v r

ETagt=i)v¢v l%i)n'�(o �<�

...ETag: " xyzzy”...< ENTITY >

GET someURL...

Page 46: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Validazione indip endent e

dal c loc k ( I I )

HTTP/ 1. 1 304 Not Modi f i ed. . .ETag: ” xyzzy”. . .

GET someURL. . .I f - None- Mat ch: " xyzzy”. . .

HTTP/ 1. 1 200 OK. . .ETag: ” aBBzzy”. . .

< ENTI TY >

GET someURL. . .I f - None- Mat ch: " xyzzy”. . .

������������� � �������

������������������� ����� ���

Esempio

��� �"!�#%$'& ()&*$��,+.-/+0!1#�2435#%6768#,9:&�& ;��<#�24& 2=#>��;?$�@%#AB(DC8EGF%9�& ()& #.91C H.& ;I$�#J35� �<F:K FG!�#�2�$�F:3L!��.68& M.& K &*6)NO$�F:;P+�-/Q

Page 47: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Osservazione

�������������� ��� ���������� ������������� � �"!#�$���%����� �&�'�)(�*&*,+.-&�0/�1�����/2��Expires�Last-Modified

�Etag

��34343

URL HTTP Response... ...... ...... ...

URL Entity... ...... ...... ...

Basic cach in g r u l e

(r e v isit e d I )

57698':$;�:0;=<�>�?A@'B">0CDC2>�EF>�;HG�8'IKJ L�@AEF:�MN:)JO8"PQG0RSG"RA:.C2;�:�T=:�U ;�:�EF>U :�V�:AC�J ;WEX@AU >ZY

5)[&>'T=:�UOJ RA:�M\>�>�8�M�E^]_;�<'>"C�G�8=G�I`EF>ACa<5b6%M�JOUcJ dDde:�>&8�M�E^]$;=<�>.CeG�8�GbC2M\:�U >5gfFf4f

h�iejDk lnmpo4k q�rsk tvu

w x^y�zp{ zX|~}'� y|

�=���������2�H��������� � � �������^� �����\�������p�H�\������� ��� ���a���^�

Page 48: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Esempio:

c a c h e M S I n t er n et Ex pl or er

Esempio:

c a c h e O per a

����������� ��� �� ������� ��������������������������� ������!� "#������ ��!��$����%�����&� �('�����) ���+*-, .�/�/�/

Page 49: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Basic cach in g r u l e

(r e v isit e d I I )

������������� ������� ����� ��� ������� � !"�#����$ �%�&�%'���(���(��)�*���"+,��-.�����/ -&�%0������.�1�2�#-& 43

�657 8+9��-&�:(���$ % ;�<$ �>=?���� @��������A�� ��B��C�7$ �:-:� DD��E ��F$A�>=6��� @�B�����G�H$A��-: �JIKI>I

�ML8N�OQP�R*P�S4T U#VFR�NHWFN&R#U�PXTYNHU;Z*[%\�[#W#PXR*P�[�O�OQ[4]>[6]�N OB^�[;_`_aS;_2Nbdcfehg"i8j U�S�U;Z�[�kKkKk

lnm�op#q2r�r&s;tQu4v�r qwr�r:syxs)zA{Xva|}o�u;~#{Xs#{�u�ttQu4v>u%u4� p4�*{Xv>p;q2rHo�p4��t�u<vK~�u4vl��;uf� �&���7�)v/r zAu4v�r q�{�o�p4�Bz`{�va|��6rYs)��p��;��u��"rHo�p;q�r���{�q�v u<��*u4v>{Js#{Xs

p4v�v�r ~#p4v>uEp4��t�u4vK~#u4v

�Fu��{X� uf�<�<���f�;�A��l

PUT URL-X ����H�����F�w�¡ @¢¤£ ¥1¦Q§�¦�¨��H©�ª*£ ��¥B��«¬§#­¡¦Q§�®A¯°£ ¥�ª�§#± £ ²*¯��´³Fµ;¶�µ)��·�·9��­K�¤­A£ ª�§�± £ ²�§�®A¯l

GET URL-X?data ��¸�9§°­A£ ·�¹�¯�·�®A§¤¥�¯�¥�¹*º�»¼�H·w·,��­K�°«½§#¥�®A��¥�º�®A§�£ ¥1¦Q§�¦�¨��

Invio dati di f or m

Page 50: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Cache-control�Cache-control����������� ������������ ���������������� �!"��#$#%� ���&'��(������ )�� �*��#+�����,�-� .0/21�3

�Cache-control: must-revalidate�546���7�8#+��9�7��(��������:�7�����;�7�<�=��9�?>�@BADC�E8@FG� �����-� �7��#+�?�H�7������I���,J ������K��?�=��� �:������K��;)L�M�<���?��� �H)�� N �L��#+��(��� ������9�:�,��#%IO:�8#G��� �P

�Cache-control: no-cache�546���7�8#+��9�7��(��������Q�����5(��R:�7�*����9�TSU���H#+���7�H#+���-�V���W��K��

XUYWZ9[$\^]`_!acbed'fMg`h%hjilk�i _li-anm�ococo

Curiosità…

(caos totale)

HTTP/1.0 302 Moved TemporarilyDate: Tue, 15 Feb 2005 10:57:50 GMTServer: Apache/1.3.26 Ben-SSL/1.48 (Unix) Debian GNU/Linux PHP/4.1.2X-Powered-By: PHP/4.1.2Location: http://webmail.units.it/horde/imp/mailbox.php?mailbox=INBOX&actionID=105&Horde=7abd2dfe6dfd7247f1d394a823d78446Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0Pragma: no-cacheSet-Cookie: Horde=7abd2dfe6dfd7247f1d394a823d78446; path=/horde; domain=webmail.units.itExpires: Thu, 19 Nov 1981 08:52:00 GMTContent-Type: text/html; charset=ISO-8859-1

pWq r8s�t�rGuLvxw�vzy'{�|H}~v�q �-�0����q ��� uG�"q {Hr�u"{���q u

���`���=�n���"� ���M���<�c�6�����V���,�G�`������j�8�`�$���I�`�W���c�6� �V�%���%���

Page 51: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Proxy H T T P

������������ ����������� ��� ����������������� �!���"�!��#����$���%� &��!��'����$&�()�*��#$(*&�� ++(,+�� �*&��&�(�-.� #/�.��&��0��213� 42����($��� �%�0576!8*9�:<;>=/=>?

Proxy H T T P ( I )

@ACBED!FGIHIHJ@

KMLNPO�LQASRELQA

T U

V

W

Page 52: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

����������� ���������������� ����������� �!�"�#�!�"$%�&�('*),+.-/� 01� �#����2436573(8:94;�<(= >?3(8:9@3BA�C%DFE�G&H�GIDF8�3J<(=IK";8�G L

��������� �����������M�"NO���"�������P�!�2436573(8:94;�<(= >?3(8:9@3BA�C%DFE�G&H�3(8�Q�E�8�3 <(=IK";R8�G L

��):�(���S� TUTU�����M�S�"V(W�V:X6Y[Z�\]N^���?������N^�/�P�!�����S�"_%��`�� �����Iab��� �#�2cQ�E�K";">?3(8:9@G�Q�3(=S=cd ;9@3�8:9@3fegC%E(hUh1E�8�Ei3�hUh13D43 ;(9jGS=IGOC,3Dk=cd ;9@38�9@3 lPL

��mP���#nb�R�#�#�����M� �M�P�R-:� $��(T�� �����JoMoMop�(_?����$��/��� TqTU�(TP� ������"NR�����"�#���P���R01� �����g� 0r��� ��!�P_��?�s�P�#���F���R�utc�sm?���F� -R��!� v

w -R���"���$�$�� �����m�����0B�#�(TP� �����

Proxy H T T P ( I I )

x�y�z({}|r~�y�����%~��R~J~�|q|B~�y�~J�^z��P�4� ����y���#z���~�y*�|B��y�~M�S����y�z���J|1��~�� �c� �^��#z�����������"�^��|rz����^z��S� z����:� �?�P�����]�Oz��b���P~�����y�z���

Proxy H T T P ( I I I -a )

GET /hypertext/WWW/TheProject.html HTTP/1.1...Host: www.w3.org...<linea vuota>

www.w3.org

�P���1�U�

Page 53: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

����������� ���������������� ������� ��� � �"!#�����$��%����&�'�(�*)��

�,+-%.����/����0� � �*1*�2%������� ���43��(56%.��78�9;:�<>=@?*A8A8B"C�B D <�E�F.<.G'<.H�I#J�K(K�LNM*<�AO= ?(G�AP<NAP<.G'Q8ISRO?�G@[email protected]<>B"D'AW<.HYX'<.H9[Z\D T]HUB ^_<.G@T`B

9ba6<.G'<.H�I>G.c'?dX I#J�K(KeLfM*<�g�c'<�A]Thji k(lnmpo�q'r'k(q�sStUr�u�odr vxw�y.r�z�qdr't{qdr�m m zSt$rdu(o'r vxw�s't|i }�i k.z'tUi"zn~

9��]G@X�B I�I.DdAn<.H�Xd<.H92Z\D D I>HUB R8<�QxB ?�G'<f�.<.D D I�J�K�KeLNM*<�A8='?(G�AP<�E(F*<.G'<.HVI>G.c'?dX'I�J�K(KeLfM*<�AO= ?(G�AP<

hUi k(lnm�o.q r'k�qds�tUr'v]��sdk�vOr-y*rdz*q r't�q'r'm"m z�tUr'v`��sdk�v8rfsdtUi }�i k.z'tUi"zW~9�M�B A8= ?(G'��<fI.D�C�HY?���AW<*H

Proxy H T T P ( I I I -b )

Browser:

O p era

��������� �$���������6�����O�$�&�\���.� �6������n���|�$��� �� ]� ¡.¢�� ���8�`�

���� �£¥¤e¦�������� �¨§|�6 $©#�http://ª �����.���\�.�O��  ª �� ����.�6� ¡@���]�

Page 54: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Browser:

M S I n t ern et E x p l orer

Proxy a i t e m p i d i H T T P 1 . 0 ( I )

GET /hypertext/WWW/TheProject.html HTTP/1.1...Host: www.w3.org...<linea vuota>

���������

� ��������� ��������� � �� � ��� ������� �"!

Page 55: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

����������� ������������������������� �!�"�#���%$ &'�)( *�+�+�&�����+�$,� �-+������.���+/0� �%�21!3%3�465798;:<+=� >?( @A����&'�B+6� �%���'��&%���6����+C DFEG� *�

@G�%�H�%��&%����� �JI��G���#���A�H���K�?�����L�M&���� +=$,�H�N(

Proxy a i t e m p i d i H T T P 1 . 0 ( I I )

GET http://www.w3.org/hypertext/WWW/TheProject.html HTTP/1.0......<linea vuota>

www.w3.org

OHPRQTS�U

VXW�Y�Z[]\L^A_�` a#bdc%eHf-g=e g!Y"g#Y�gh�` g�iKf?j�k�l�m�noeqp Z�rV�k�e�Y�ghA`Hg�iKf?j?k�lLmd_G`�a;sTZ=e]fBg!e�g%Y�g;t�c'fNn�_GYun v�c'fNn

w�x�y�z"{�{,|'}T~�u{9z"{�{o|q�����-��������� �

VX��gs<g�i�i c!Y�n Z�`Ge;bdgs�s<c%e�n i<b�Z�_Hg%Y�n,eH��Z�Y-b�c!Y"g#n,p�_�Y�Z'[ \�s'�Hg;c%p s�`Je�nbdg�i�i�cr�rAn]t�g�v�Z=e Z�g�i�i�g%Y�g��<t�n�bdg%e]f)n s<c'fNn �

Proxy: L og g i n g ( I )

Page 56: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

�Cache-control: no-store

� The no-store directive MAY be sent either in a response or in arequest.

� If sent in a request, a cache MUST NOT store any part of either this request or any response to it.

� If sent in a response, a cache MUST NOT store any part of either this response or the request that elicited it.

��������� ����

Proxy: L og g i n g ( I I )

�By their very nature, HTTP proxies ... represent an opportunity for man-in-the-middle attacks. Compr omi se of t he syst ems on whi ch t he pr oxi es r un can r esul t i n ser i ous secur i t y and pr i vacy pr obl ems...A compromised proxy, or a proxy implemented orconfigured without regard to security and privacy considerations,might be used in the commission of a wide range of potential attacks.

�...log information gathered at proxies often contains highlysensitive personal information...

�Because cache contents persist after an HTTP request is complete,an attack on the cache can reveal information long after a userbelieves that the information has been removed from the network.Therefore, cache contents should be protected as sensitiveinformation.

�User s of a pr oxy need t o be awar e t hat t hey ar e no t r ust wor t hi er t han t he peopl e who r un t he pr oxy…��������������� �

Importante

Page 57: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Caching in P r o x y

( ap p r o f o nd im e nt i)

�������������� ��������� ����������������� �"!$#&%('�%

��)*����+-,. ��������� ���������������0/�132(45!6#.!87�%

�:9��<;=�>?����@A� �B�������DC EGF��B���-�H�JIK�L� ����@M�N���&���B���*F��L�O� �"!6#&%&'P1RQ*��CSC EGF-�H���-�B�UTWV

Proxy: C a c h e c on d i v i s a ( I )

X"Y6ZP[�\

Page 58: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Esempio problematico (I)

GET /msg3.html HTTP/1.1Host: webmail.tiscali.comCookie: 12345...<linea vuota>

���������

� ������� ������� ������������ ��� �!�#"%$&� ��'�(! �)�� ���)(*�+� �+,-�.��� � / 0#$21

webmail.tiscali.com/msg3.html

Esempio problematico (II)

GET /msg3.html HTTP/1.1Host: webmail.tiscali.comCookie: 67890...<linea vuota>

3�4�5�6�7

8:9<;>=!?A@ B�C�D�C+EGF%H D�I J!JLKNM&F O�P+Q>B*O)FD ORO)Q C�@ D+S-D.D�H H T U:MWV

webmail.tiscali.com/msg3.html

Page 59: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

������������� ������������������� ������������ � �����"!#�����$���%��!#������!#��'&$�� (%)%)+*,�-�$�.�/� ��021�3�465�3�487 9/:;3�4<7 :>="3

Cache-control: no-cache7 9?4<7 :"@�A�:�BC3

�ED��������F� � G���HI��/!J� �K���-!;��� !C!;� G���ELM�8N!;&/!#!#�'� �'�O� �/�����"!#���������%�������P!#������8��Q�'&$�� (�)�)+*��R���F� � �8

�S�8��T����� G���!J�U>V�WXV�Y[Z]\_^�`M\aY,Ycb�d]\fe�\ g

Soluzione parziale

Soluzione migliore

hCache-control: no-cache = headerNamehQikj�l�m-n#o'p�l$m q�r8s�mSl q�j�tQl$m.mSl%pKlvu�o%s�n#l�s�j/n#o'wfsNxFo�x�y�l,z�r8q�rco�{�l�p�ll�|fwauQwfs�o�n#rT| o'|}wfs�lRo'y�lRoRz$l�p�~Mo%uIl

�����R�K�C�N�X�_�6�#�����X�;���a��� �a�_�����6���

Page 60: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

�������������� ������ ��������� �����������! #"%$����&���(')� ���+*,�-�-./���Authorization:

�10�����2,34�5��������� �76%�4�8 9":$����5�;6%�<6�*,�������������=���� 6�*/� �-.������ �7�>�������8 ?"%$��

�A@���';�B�����(� ���C6�*,�+� D5E,�����,���F=G��� 6%�������8 9":$��H�I���KJ7�C��E����,�L� 6%���M�N��O

Proxy: C a c h e c on d i v i s a ( I I -a )

PIQSR&TLU

V�W-X/Y>Z W�[�\�\8]+^-_`^�ab

When a shared cache receives a request containing an Authorization field, it MUST NOT return the corresponding response as a reply to any other request

cedgfIh:iKjkj,f�fLjIlImgn:i�mKfLoKjki�nNi�p�j,q:msr:tunKvwvxv

Proxy: C a c h e c on d i v i s a ( I I -b )

Page 61: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

����������� ����������� ���������������� ������� ������!����#"%$&�(')�*�+�,� -'.�0/013254760(� �8����� �:97�; �<�('=!:��� �*�>��?@Range@Transfer-encoding@Accept@BA#C�DFE<GHJILK%I M I HONQP7C�R.S*T�TVU,W<X%Y�Z

@Upgrade@Vary@Age@[Y\Y\Y

Osservazioni

]... there are a wide variety of architectures and configurations of caches and proxies currently being experimented with or deployed across the World Wide Web.

]These systems include national hierarchies of proxy caches to save transoceanic bandwidth,systems that broadcast or multicast cacheentries, ...

]_^a`�bdc�`�e�fhgji�`Vi�g7i�`lk i�`am�n o=i�gpg7i�`�q r#n:s�b=q<b*t�i�s�b�q<euswv�x3y5z {|m�`�e*}�~]��ar#s e�`��)b#�3� ih�*�:r i(`�b(`�q ��~�e#��m:`�e�}%~&q<b�q*��i�g<��gje�s e0� e#�Vr q<b-�.i�s�t�idm�b�`�t�i

� i(���������u�����3s e�s � i���� ����zj�|��zj�

“H i e r a r c h i e s o f p r o x y c a c h e s ”

Page 62: 10 2 - unina.stidue.netunina.stidue.net/Universita' di Trieste/Ingegneria... · )+*-,/.10 2 342 5 687(.92: ;(5,?. 0@,a;&bc.(21*-;&5 7&=d,/.10+;e. ,/f1geg8g hji(kl;&0@;&5";mfnf;po

Possibile architettura (I)

�����������

���� �� ���� �������

��� ����������� � �! � ���� ��"

������������ ��#�#���$��� %�� �&�'�� �

� � �(����� � �������#��� � �) � ���� ��"

*!+-,#.�/ 021�35461�798�,�:�;=<?>A@�7�BC,9:D76@$4FE�/G7�8�,&H�,�:IH�7�@#J�BC,�8�1(7*!K�J�8�EF/D7�8�4ML-3�/ 8�@�/ LN4�: BC,�8�1(,OH�4PLN3Q7#R�S*!T67�1�3�,�U�U6,C4WV5,�3�,O@�7�L-/ 4OH�,�:�@�7�8�1X,�8�J61�7Y0F1X461�/Z@�7

Possibile architettura (II)

[�\�]�^�\�]

_�`�a�b�c d�ef ](g�h�i

j!k-l m nporqYsut�v(w$m lGn�x�yj!k-n6z�l {5l |�n}orn�{�~F�O��xY�-{r�#����z�n�m mGq�-{r�#��{5lGqC��{�|�q�x�l ���Fq2�FlD��x�njA�2��q6zC��q�mGq�x�w$l x�|jAt�{���~$~�l �ClZy(��|�n��F|-{�q���lZw$qj�������~-�j����X�

[�\�]�^�\�]� `�a#a�\6�$��c �6c � \&�'g�� g

`�� f ](g�h2i��