Index: openacs-4/packages/acs-tcl/tcl/acs-cache-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/acs-cache-procs.tcl,v diff -u -N -r1.10.2.30 -r1.10.2.31 --- openacs-4/packages/acs-tcl/tcl/acs-cache-procs.tcl 29 May 2022 19:15:44 -0000 1.10.2.30 +++ openacs-4/packages/acs-tcl/tcl/acs-cache-procs.tcl 14 Jun 2022 17:59:36 -0000 1.10.2.31 @@ -576,6 +576,7 @@ } nx::Class create Cluster { + :property {proto http} :property host :property {port 80} :property {url /acs-cluster-do} @@ -713,15 +714,14 @@ } :public method message args { - :log "--cluster outgoing request to ${:host}:${:port} // $args" + :log "--cluster outgoing request to ${:proto}://${:host}:${:port} // $args" try { - ns_http run http://${:host}:${:port}/${:url}?cmd=[ns_urlencode $args] + ns_http run ${:proto}://${:host}:${:port}/${:url}?cmd=[ns_urlencode $args] } on error {errorMsg} { - ns_log warning "-cluster: send message to http://${:host}:${:port}/${:url}?cmd=[ns_urlencode $args] failed: $errorMsg" + ns_log warning "-cluster: send message to ${:proto}://${:host}:${:port}/${:url}?cmd=[ns_urlencode $args] failed: $errorMsg" } on ok {result} { ns_log notice "-cluster: response $result" } - #util::http::get -url } } } Index: openacs-4/packages/acs-tcl/tcl/cluster-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/cluster-init.tcl,v diff -u -N -r1.1.2.5 -r1.1.2.6 --- openacs-4/packages/acs-tcl/tcl/cluster-init.tcl 29 May 2022 19:15:13 -0000 1.1.2.5 +++ openacs-4/packages/acs-tcl/tcl/cluster-init.tcl 14 Jun 2022 17:59:36 -0000 1.1.2.6 @@ -21,6 +21,7 @@ } ns_log notice "Cluster: server $host $port is a cluster peer" ::acs::Cluster create CS_${host}_${port} \ + -proto $proto \ -host $host \ -port $port \ -url $cluster_do_url Index: openacs-4/packages/acs-tcl/tcl/server-cluster-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/server-cluster-procs.tcl,v diff -u -N -r1.10.2.5 -r1.10.2.6 --- openacs-4/packages/acs-tcl/tcl/server-cluster-procs.tcl 27 Oct 2021 16:42:15 -0000 1.10.2.5 +++ openacs-4/packages/acs-tcl/tcl/server-cluster-procs.tcl 14 Jun 2022 17:59:36 -0000 1.10.2.6 @@ -67,15 +67,28 @@ return [list host $my_ips port $my_ports] } -ad_proc -private server_cluster_get_config {hostport} { +ad_proc -private server_cluster_get_config {location} { Return a dict parsed from the host and port spec. - If no port is specified, it defaults to 80 + If no port is specified, it defaults to 80. + If no scheme is specified, it defaults to "http". + In case the hostname is provided as an DNS name, it is resolved. - @param hostport IP address with optional port - @return dict containing host and port + @param location location (e.g., https://localhost:8443) or just host with optional port + @return dict containing proto, host, and port } { - set d {port 80} - return [dict merge $d [ns_parsehostport $hostport]] + set d {port 80 proto http} + if {[regexp {^([^:]+)://} $location . proto]} { + if {$proto eq "https"} { + set d {port 443 proto https} + } + set d [dict merge $d [ns_parseurl $location]] + dict unset d tail + dict unset d path + } else { + set d [dict merge $d [ns_parsehostport $location]] + } + dict set d host [ns_addrbyhost [dict get $d host]] + return $d }