#!/usr/bin/env tclsh
# $Id$
package require tdom
-set RPC_URL "http://127.0.0.1/koakuma/rpc"
foreach arg $argv {
if { [string range "$arg" 0 0] == "-" } {
if { "$arg" == "-h" || "$arg" == "--help" } {
foreach path [glob "@@PREFIX@@/lib/koakuma/utility/*.tcl"] {
source $path
}
-if { [info exists "env(KOAKUMA_RPC)"] } {
- set RPC_URL "$env(KOAKUMA_RPC)"
-}
-set RPC_URL "[regsub {/+$} "$RPC_URL" ""]"
puts -nonewline "Authentication: "
set status [::rpc::require-auth]
if { $status == 1 } {
package require base64
package require term::ansi::ctrl::unix
+catch {
+ package require tls
+ ::http::register https 443 ::tls::socket
+}
+
+set RPC_URL "http://127.0.0.1/koakuma/rpc"
+if { [info exists "env(KOAKUMA_RPC)"] } {
+ set RPC_URL "$env(KOAKUMA_RPC)"
+}
+set RPC_URL "[regsub {/+$} "$RPC_URL" ""]"
+
namespace eval rpc {
proc require-auth {} {
global RPC_URL