Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Fixes to demos to add 'package prefer latest', use updated TCL website URL, etc. |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk | main | tls-2.0 |
| Files: | files | file ages | folders |
| SHA3-256: |
9a625532b90da734c405cff276b5a154 |
| User & Date: | bohagan 2025-10-13 21:56:05 |
Context
|
2025-10-16
| ||
| 09:33 | Fix various compiler warnings (like -Wconversion and -Wc++-compat) check-in: 9a7e09fcca user: jan.nijtmans tags: trunk, main, tls-2.0 | |
|
2025-10-14
| ||
| 22:08 | Updates to fix issues with building static libraries check-in: 6108512e1f user: bohagan tags: trunk, main, tls-2.0 | |
|
2025-10-13
| ||
| 21:56 | Fixes to demos to add 'package prefer latest', use updated TCL website URL, etc. check-in: 9a625532b9 user: bohagan tags: trunk, main, tls-2.0 | |
|
2025-10-11
| ||
| 19:10 | Updates for OpenSSL 1.1.1, 3.3. and 3.4 API compatibility check-in: 651e6cb534 user: bohagan tags: trunk, main, tls-2.0 | |
Changes
Changes to demos/echat.tcl.
| ︙ | ︙ | |||
261 262 263 264 265 266 267 |
if {$mode eq "client"} {
set cmd [list message_send ::chan $e]
} else {
set cmd [list send_all $e]
}
set b [ttk::button $f.b -command $cmd -text "Send"]
bind $e <Return> $cmd
| | | 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 |
if {$mode eq "client"} {
set cmd [list message_send ::chan $e]
} else {
set cmd [list send_all $e]
}
set b [ttk::button $f.b -command $cmd -text "Send"]
bind $e <Return> $cmd
set sh [ttk::scrollbar $f.hsb -command [list $e xview] -orient horizontal]
grid $e -row 0 -column 0 -sticky nsew
grid $b -row 0 -column 1 -sticky nsew
grid $sh -row 1 -column 0 -sticky nsew
wm protocol $w WM_DELETE_WINDOW shutdown
}
|
| ︙ | ︙ |
Changes to demos/gets_blocking_no_variable.tcl.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ################################################# # # Example 1: Blocking channel gets with no variable # ################################################# package require Tcl 8.6- package require tls set host "www.google.com" set port 443 set path "/" set protocol "http/1.1" | > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ################################################# # # Example 1: Blocking channel gets with no variable # ################################################# package prefer latest package require Tcl 8.6- package require tls set host "www.google.com" set port 443 set path "/" set protocol "http/1.1" |
| ︙ | ︙ |
Changes to demos/gets_blocking_with_variable.tcl.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ################################################# # # Example 2: Blocking channel gets with variable # ################################################# package require Tcl 8.6- package require tls set host "www.google.com" set port 443 set path "/" set protocol "http/1.1" | > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ################################################# # # Example 2: Blocking channel gets with variable # ################################################# package prefer latest package require Tcl 8.6- package require tls set host "www.google.com" set port 443 set path "/" set protocol "http/1.1" |
| ︙ | ︙ |
Changes to demos/gets_nonblocking_no_variable.tcl.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ################################################# # # Example 3: Non-blocking channel gets with no variable # ################################################# package require Tcl 8.6- package require tls set host "www.google.com" set port 443 set path "/" set protocol "http/1.1" | > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ################################################# # # Example 3: Non-blocking channel gets with no variable # ################################################# package prefer latest package require Tcl 8.6- package require tls set host "www.google.com" set port 443 set path "/" set protocol "http/1.1" |
| ︙ | ︙ | |||
70 71 72 73 74 75 76 |
vwait ::wait
catch {close $ch}
}
set data ""
gets_non_blocking_no_variable $host $port $path $protocol
| | | 71 72 73 74 75 76 77 78 |
vwait ::wait
catch {close $ch}
}
set data ""
gets_non_blocking_no_variable $host $port $path $protocol
save_file "gets_nonblocking_no_variable.txt" $data
|
Changes to demos/gets_nonblocking_with_variable.tcl.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ################################################# # # Example 4: Non-blocking channel gets with variable # ################################################# package require Tcl 8.6- package require tls set host "www.google.com" set port 443 set path "/" set protocol "http/1.1" | > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ################################################# # # Example 4: Non-blocking channel gets with variable # ################################################# package prefer latest package require Tcl 8.6- package require tls set host "www.google.com" set port 443 set path "/" set protocol "http/1.1" |
| ︙ | ︙ | |||
69 70 71 72 73 74 75 |
vwait ::wait
catch {close $ch}
}
set data ""
gets_non_blocking_with_variable $host $port $path $protocol
| | | 70 71 72 73 74 75 76 77 78 |
vwait ::wait
catch {close $ch}
}
set data ""
gets_non_blocking_with_variable $host $port $path $protocol
save_file "gets_nonblocking_with_variable.txt" $data
|
Changes to demos/gets_with_debug_data.tcl.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ################################################# # # Example 4: Non-blocking channel gets with variable # ################################################# package require Tcl 8.6- package require tls set host "www.google.com" set port 443 set path "/" set protocol "http/1.1" | > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ################################################# # # Example 4: Non-blocking channel gets with variable # ################################################# package prefer latest package require Tcl 8.6- package require tls set host "www.google.com" set port 443 set path "/" set protocol "http/1.1" |
| ︙ | ︙ |
Changes to demos/http_debug_example.tcl.
1 2 3 4 5 6 7 8 9 10 | ################################################# # # Download webpage using HTTP package with debug output # ################################################# package require Tcl 8.6- package require tls package require http | > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
#################################################
#
# Download webpage using HTTP package with debug output
#
#################################################
package prefer latest
package require Tcl 8.6-
package require tls
package require http
set url "https://www.tcl-lang.org/"
set port 443
set protocol "http/1.1"
# Register https protocol handler with http package
http::register https 443 [list ::tls::socket -autoservername 1 -require 1 -alpn [list [string tolower $protocol]] \
-command ::tls::callback -password ::tls::password -validatecommand ::tls::validate_command]
|
| ︙ | ︙ |
Changes to demos/http_get_file.tcl.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ################################################# # # Download file using HTTP package # ################################################# package require Tcl 8.6- package require tls package require http set url "https://wiki.tcl-lang.org/sitemap.xml" set protocol "http/1.1" set filename [file tail $url] | > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ################################################# # # Download file using HTTP package # ################################################# package prefer latest package require Tcl 8.6- package require tls package require http set url "https://wiki.tcl-lang.org/sitemap.xml" set protocol "http/1.1" set filename [file tail $url] |
| ︙ | ︙ |
Changes to demos/http_get_webpage.tcl.
1 2 3 4 5 6 7 8 9 10 | ################################################# # # Download webpage using HTTP package # ################################################# package require Tcl 8.6- package require tls package require http | > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ################################################# # # Download webpage using HTTP package # ################################################# package prefer latest package require Tcl 8.6- package require tls package require http set url "https://www.tcl-lang.org/" set port 443 set protocol "http/1.1" # Register https protocol handler with http package http::register https 443 [list ::tls::socket -autoservername 1 -require 1 -alpn [list [string tolower $protocol]]] # Get webpage |
| ︙ | ︙ |
Changes to demos/http_get_webpage_proxy.tcl.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ################################################# # # Download webpage using HTTP and proxy packages. # # Process: # - Connect to the proxy # - Send HTTP "CONNECT $targeturl HTTP/1.1". # - Proxy responds with HTTP protocol response. # - Do tls::import # - Start handdshaking # ################################################# package require Tcl 8.6- package require tls package require http package require autoproxy autoproxy::init | > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
#################################################
#
# Download webpage using HTTP and proxy packages.
#
# Process:
# - Connect to the proxy
# - Send HTTP "CONNECT $targeturl HTTP/1.1".
# - Proxy responds with HTTP protocol response.
# - Do tls::import
# - Start handdshaking
#
#################################################
package prefer latest
package require Tcl 8.6-
package require tls
package require http
package require autoproxy
autoproxy::init
set url "https://www.tcl-lang.org/"
set port 443
set protocol "http/1.1"
# Set these if not set by OS/Platform
if 0 {
autoproxy::configure -basic -proxy_host example.com -proxy_port 880 -username user -password password
}
|
| ︙ | ︙ |
Changes to demos/read_blocking_webpage.tcl.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ################################################# # # Read using blocking channel # ################################################# package require Tcl 8.6- package require tls set host "www.google.com" set port 443 set path "/" set protocol "http/1.1" | > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ################################################# # # Read using blocking channel # ################################################# package prefer latest package require Tcl 8.6- package require tls set host "www.google.com" set port 443 set path "/" set protocol "http/1.1" |
| ︙ | ︙ |
Changes to demos/read_nonblocking_webpage.tcl.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ################################################# # # Read using blocking channel # ################################################# package require Tcl 8.6- package require tls set host "www.google.com" set port 443 set path "/" set protocol "http/1.1" | > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ################################################# # # Read using blocking channel # ################################################# package prefer latest package require Tcl 8.6- package require tls set host "www.google.com" set port 443 set path "/" set protocol "http/1.1" |
| ︙ | ︙ |