Hex Artifact Content

Artifact 42b678e261ff84c13d2540873e086f52fb22a6740a7c479daa5f41b8e39d22d4:


0000: 54 68 69 73 20 64 69 72 65 63 74 6f 72 79 20 63  This directory c
0010: 6f 6e 74 61 69 6e 20 65 78 61 6d 70 6c 65 20 66  ontain example f
0020: 69 6c 65 73 20 66 6f 72 20 68 6f 77 20 74 6f 20  iles for how to 
0030: 75 73 65 20 74 68 65 20 54 4c 53 20 70 61 63 6b  use the TLS pack
0040: 61 67 65 20 74 6f 20 70 65 72 66 6f 72 6d 0a 63  age to perform.c
0050: 6f 6d 6d 6f 6e 20 66 75 6e 63 74 69 6f 6e 73 2e  ommon functions.
0060: 20 54 68 65 73 65 20 61 72 65 20 6a 75 73 74 20   These are just 
0070: 61 20 66 65 77 20 6f 66 20 74 68 65 20 70 6f 73  a few of the pos
0080: 73 69 62 69 6c 69 74 69 65 73 2e 0a 0a 67 65 74  sibilities...get
0090: 73 5f 62 6c 6f 63 6b 69 6e 67 5f 6e 6f 5f 76 61  s_blocking_no_va
00a0: 72 69 61 62 6c 65 2e 74 63 6c 0a 44 6f 77 6e 6c  riable.tcl.Downl
00b0: 6f 61 64 20 61 20 77 65 62 70 61 67 65 20 75 73  oad a webpage us
00c0: 69 6e 67 20 67 65 74 73 2c 20 6e 6f 20 76 61 72  ing gets, no var
00d0: 69 61 62 6c 65 20 61 72 67 2c 20 61 6e 64 20 62  iable arg, and b
00e0: 6c 6f 63 6b 69 6e 67 20 49 2f 4f 2e 0a 0a 67 65  locking I/O...ge
00f0: 74 73 5f 62 6c 6f 63 6b 69 6e 67 5f 77 69 74 68  ts_blocking_with
0100: 5f 76 61 72 69 61 62 6c 65 2e 74 63 6c 0a 44 6f  _variable.tcl.Do
0110: 77 6e 6c 6f 61 64 20 61 20 77 65 62 70 61 67 65  wnload a webpage
0120: 20 75 73 69 6e 67 20 67 65 74 73 2c 20 76 61 72   using gets, var
0130: 69 61 62 6c 65 20 61 72 67 2c 20 61 6e 64 20 62  iable arg, and b
0140: 6c 6f 63 6b 69 6e 67 20 49 2f 4f 2e 0a 0a 67 65  locking I/O...ge
0150: 74 73 5f 6e 6f 6e 62 6c 6f 63 6b 69 6e 67 5f 6e  ts_nonblocking_n
0160: 6f 5f 76 61 72 69 61 62 6c 65 2e 74 63 6c 0a 44  o_variable.tcl.D
0170: 6f 77 6e 6c 6f 61 64 20 61 20 77 65 62 70 61 67  ownload a webpag
0180: 65 20 75 73 69 6e 67 20 67 65 74 73 2c 20 6e 6f  e using gets, no
0190: 20 76 61 72 69 61 62 6c 65 20 61 72 67 2c 20 61   variable arg, a
01a0: 6e 64 20 6e 6f 6e 2d 62 6c 6f 63 6b 69 6e 67 20  nd non-blocking 
01b0: 49 2f 4f 2e 0a 0a 67 65 74 73 5f 6e 6f 6e 62 6c  I/O...gets_nonbl
01c0: 6f 63 6b 69 6e 67 5f 77 69 74 68 5f 76 61 72 69  ocking_with_vari
01d0: 61 62 6c 65 2e 74 63 6c 0a 44 6f 77 6e 6c 6f 61  able.tcl.Downloa
01e0: 64 20 61 20 77 65 62 70 61 67 65 20 75 73 69 6e  d a webpage usin
01f0: 67 20 67 65 74 73 2c 20 76 61 72 69 61 62 6c 65  g gets, variable
0200: 20 61 72 67 2c 20 61 6e 64 20 6e 6f 6e 2d 62 6c   arg, and non-bl
0210: 6f 63 6b 69 6e 67 20 49 2f 4f 2e 0a 0a 67 65 74  ocking I/O...get
0220: 73 5f 77 69 74 68 5f 64 65 62 75 67 5f 64 61 74  s_with_debug_dat
0230: 61 2e 74 63 6c 0a 44 6f 77 6e 6c 6f 61 64 20 61  a.tcl.Download a
0240: 20 77 65 62 70 61 67 65 20 75 73 69 6e 67 20 67   webpage using g
0250: 65 74 73 20 77 69 74 68 20 61 64 64 69 74 69 6f  ets with additio
0260: 6e 61 6c 20 64 65 62 75 67 20 6f 75 74 70 75 74  nal debug output
0270: 2e 0a 0a 68 74 74 70 5f 64 65 62 75 67 5f 65 78  ...http_debug_ex
0280: 61 6d 70 6c 65 2e 74 63 6c 0a 44 6f 77 6e 6c 6f  ample.tcl.Downlo
0290: 61 64 20 61 20 77 65 62 70 61 67 65 20 75 73 69  ad a webpage usi
02a0: 6e 67 20 68 74 74 70 20 70 61 63 6b 61 67 65 20  ng http package 
02b0: 77 69 74 68 20 61 64 64 69 74 69 6f 6e 61 6c 20  with additional 
02c0: 64 65 62 75 67 20 6f 75 74 70 75 74 2e 0a 0a 68  debug output...h
02d0: 74 74 70 5f 67 65 74 5f 66 69 6c 65 2e 74 63 6c  ttp_get_file.tcl
02e0: 0a 44 6f 77 6e 6c 6f 61 64 20 61 20 77 65 62 70  .Download a webp
02f0: 61 67 65 20 75 73 69 6e 67 20 74 68 65 20 68 74  age using the ht
0300: 74 70 20 70 61 63 6b 61 67 65 2e 0a 0a 68 74 74  tp package...htt
0310: 70 5f 67 65 74 5f 77 65 62 70 61 67 65 2e 74 63  p_get_webpage.tc
0320: 6c 0a 44 6f 77 6e 6c 6f 61 64 20 61 20 66 69 6c  l.Download a fil
0330: 65 20 75 73 69 6e 67 20 74 68 65 20 68 74 74 70  e using the http
0340: 20 70 61 63 6b 61 67 65 2e 0a 0a 68 74 74 70 5f   package...http_
0350: 67 65 74 5f 77 65 62 70 61 67 65 5f 70 72 6f 78  get_webpage_prox
0360: 79 2e 74 63 6c 0a 44 6f 77 6e 6c 6f 61 64 20 61  y.tcl.Download a
0370: 20 66 69 6c 65 20 75 73 69 6e 67 20 74 68 65 20   file using the 
0380: 68 74 74 70 20 61 6e 64 20 61 75 74 6f 70 72 6f  http and autopro
0390: 78 79 20 70 61 63 6b 61 67 65 73 2e 0a 0a 72 65  xy packages...re
03a0: 61 64 5f 62 6c 6f 63 6b 69 6e 67 5f 77 65 62 70  ad_blocking_webp
03b0: 61 67 65 2e 74 63 6c 0a 44 6f 77 6e 6c 6f 61 64  age.tcl.Download
03c0: 20 61 20 77 65 62 70 61 67 65 20 75 73 69 6e 67   a webpage using
03d0: 20 72 65 61 64 20 61 6e 64 20 62 6c 6f 63 6b 69   read and blocki
03e0: 6e 67 20 49 2f 4f 2e 0a 0a 72 65 61 64 5f 6e 6f  ng I/O...read_no
03f0: 6e 62 6c 6f 63 6b 69 6e 67 5f 77 65 62 70 61 67  nblocking_webpag
0400: 65 2e 74 63 6c 0a 44 6f 77 6e 6c 6f 61 64 20 61  e.tcl.Download a
0410: 20 77 65 62 70 61 67 65 20 75 73 69 6e 67 20 72   webpage using r
0420: 65 61 64 20 61 6e 64 20 6e 6f 6e 2d 62 6c 6f 63  ead and non-bloc
0430: 6b 69 6e 67 20 49 2f 4f 2e 0a 0a                 king I/O...